Rich Rodecker’s blog on flash, flex, actionscript, javascript, and php, with a dash of randomness
Timeline actions not executing on loaded swfs
I had a situation where I had a CS3 fla with a movieclip on stage, with stop() actions placed on a couple of frames on the timeline. The movieclip was associated with a class through the linkage properties. When i ran the movie, everything worked as expected...however, when loading that swf into another swf, the timeline actions were being completely ignored.
After searching around for a bit I came across MovieClip.addFrameScript, which lets you dynamically add frame scripts to the timeline. The usage is simple, I could just tell it which class methods to call on which frame:
Actionscript:
-
addFrameScript(11, onEnterComplete, 31, onExitComplete);
This will call onEnterComplete() on frame 11, and onExitComplete() on frame 31.
| Print article | This entry was posted by rich on December 22, 2008 at 1:45 am, and is filed under flash. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |