Actions on timeline frames using baseclass in actionscript
I have fla file with a movieclip. The movieclip has a baseclass where some actions are performed. This fla is exported as an swc. What I want is to be able to add actions to the movieclip from it's base 开发者_如何学Pythonclass, without having to do it like onEnterFrame.
Ideas?
There's an undocumented method within MovieClip called addFrameScript which will do exactly that:
myMc.addFrameScript(2, myFunction);
function myFunction() {
trace("this is the 3rd frame");
}
(the frame number is zero based instead of one based like gotoAndPlay's)
精彩评论