gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] MovieClip as_value


From: strk
Subject: Re: [Gnash-dev] MovieClip as_value
Date: Thu, 21 Dec 2006 00:22:02 +0100

On Wed, Dec 20, 2006 at 11:05:36AM +0100, strk wrote:

> The solution that comes to my mind is NOT storing sprite_instance
> objects as instance pointers in as_value, but rather store the
> sprite *target* ("_level0.container" in this case).
> This seems to be the way to go, considering also the fact
> that typeof(container) should return 'movieclip', while currently
> it returns 'object' for MovieClips.
> 
> By storing the clip 'target', the as_value would be a reference
> to a *target* rather then to a specific instance. This also means
> that reference counting would NOT be incremented by assigning a sprite
> to an as_value, and that might result in unexpected other bugs
> (read: opening a can of worms). Anyway, I think it is worth taking
> this path.

I committed such implementation, and indeed it fixes the last failing
testcases. Still, there's a pitfall: how do we reference "unnamed" sprites ?
I know this is not possible with ActionScript (you just can NOT reference them)
but chances are you can still obtain a reference from within the sprite itself.
I'll explain better.
Consider an unnamed sprite under the root, let's say at depth 5.
The sprite contains actions in it's only frame that sets a root variable
to itself:

        _root.myself = this;

Now, the *target* for itself would be '_level0.' as the sprite is unnamed.
How would we resolve the reference back ?

This seems related to the observation by Roy about depths... should we use
depth info when no name is available ? Would this computed string be extractable
in any way from ActionScript ? [ toString() ? ]

--strk;
o




reply via email to

[Prev in Thread] Current Thread [Next in Thread]