On Sun, Mar 09, 2008 at 06:50:58PM +0300, Pavel Empty wrote:
> //Create a clip from the library and store its reference to "mc" variable.
> var mc:MovieClip = _root.attachMovie("Star", "star_mc",
> _root.getNextHighestDepth());
'mc' is a "soft reference" to the Star instance.
> //Destroy the clip
> mc.removeMovieClip();
'mc' becomes a "dangling" reference, which means it'll be looking
for a substitute with same target name when dereferenced.
> //Create another star clip once again with the same name "star_mc"
> //Notice that I do not assign the clip reference to "mc" variable.
> _root.attachMovie("Star", "star_mc", _root.getNextHighestDepth());
>
> //And now I move "mc". It references the first clip, which was destroyed.
> //I expect nothing to happen, but...
> mc._x = 100;
>
> The second clip moves!
> That is, the second clip was referenced using "mc".
Dereferencing 'mc' here yelds the new Star insatnce, having
the same target path as the original one.
--strk;
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders