Alright so I just wasted about 2 hours of my day trying to figure out why I couldn’t populate a movieclip with other clips while it was animating onto the stage.
There are two ways to encounter this error, mine was the latter:
1. You have a movieclip on the stage, and it is masked by a shape tween of any number of frames. You try to load a swf/img/mc into this movieclip on any frame, but it isn’t there once your shape tweened mask is done playing.
2. You have a movieclip on the stage associated with a class through its linkage properties. My movieclip was a holder for the recipe section of a liquor brand site that was able to import xml and create a list of drinks (after it animated in of course). There is a shape tweened mask above it and it has multiple keyframes on it. You call a function that loads new mc’s from your class and you see them (or don’t) for a split second before they disappear.
As evil as it may seem, Flash actual re-instantiates the masked movieclip every time it encounters a shape tween keyframe. I ended up putting a trace(“I AM INIT”) into my mc’s class constructor and noticed that it ran 8 times, the same number of keyframes that the masks shape had on its timeline, even though my mc existed only once.
I realized this after I unmasked the shape tween and it traced “I AM INIT” only once.
Further investigation led me to Adobe’s Help Forum once I learned the cause of my problem.
A fun little quote from that page from Adobe’s help team (bold italic for emphasis):
As long as I’m understanding the issue correctly, this is a long standing “Flashism” (not saying it’s right or desirable, but something that has required a workaround for a very long time). See if you can use nesting to get around the issue (the animation will restart when keyframes are encountered), I’ll send this issue in for review. It’s possible it has something to do with Player, although I can’t find any concrete information on this to know for sure.
As far as I know, by turning the shape tween into a movieclip, all problems go away, except now you have one more timeline to deal with (which is great when your current project consists of thousands of heavily hand animated timelines). I’m not sure I enjoy this “flashism” very much, and hope that I can help someone else out if anyone actually reads this.