//--> You only removed the MovieClip. mc.removeMovieClip();
//--> If you use "delete" it will remove the reference to the variable. delete mc; I'm glad it works this way, because I can reuse my variables. When I'm done I can call "delete" -- Keith H -- Pavel Empty wrote:
Hey! Recently I was surprised with Flash environment behavior. Just want to share with you my observations. Look at this very simple code: //Create a clip from the library and store its reference to "mc" variable. var mc:MovieClip = _root.attachMovie("Star", "star_mc", _root.getNextHighestDepth()); //Destroy the clip mc.removeMovieClip(); //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". Do you know why does Flash behave this way? My guess is that Flash keeps an absolute path to the clip inside clip reference. So, in my case, the clip "_root.star_mc" was found and then moved successfully. Pasha _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders