Monthly Archives: February 2010

Flash “Bug” – Timeline shape mask and movieclips with linkage

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.

THE SOLUTION.

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.

JP Auclair finds treasure in mm.cfg

So this seems like a nice nerdy way to start off my blog. JP Auclair managed to find a TON of information regarding all the undocumented config parameters in the dreaded mm.cfg that Flash Player uses to decide how its going to output traces and such.

Alot of this is way way over my head but it’s interesting none-the-less. As well as the fact that there is feature called AS3Turbo, which is probably like meth for flash apps.

Check it out over at http://jpauclair.net/2010/02/10/mmcfg-treasure/