I have some code in ActionScript 2 similar to the below snippet (Item being a MovieClip):
_root.createEmptyMovieClip("Temp",_root.getNextHighestDepth());
_root.Item.swapDepths(_root.Temp);
_root.Temp.removeMovieClip(); // This doesn't work !
I think the question is clear. I’m unable to remove Temp after swapping the depth (works fine otherwise).
I also tried the following (but to no avail):
depth = Item.getDepth();
_root.createEmptyMovieClip("Temp",_root.getNextHighestDepth());
_root.Item.swapDepths(_root.Temp);
_root.getInstanceAtDepth(depth).removeMovieClip(); // Doesn't work !
Any thoughts on how to get rid of Temp?
I figured out the hidden reason behind the immortality of
TempMovieClip.The MovieClip
Itemwith which it is swapped was created manually in the timeline. So after swapping,Tempis within the zone of depths for which Flash doesn’t support dynamic removal of symbols.If I’d swapped depths between
TempandItem1 = Item.duplicateMovieClip("Item1", someDepth);, theremoveClip()would’ve worked!