How to detect movieclip stop(); function?
I have a game and i use function gotoA开发者_StackOverflow社区ndStop in actionscript to play frame "moving" in my character game.And in this frame have movieclip. How can i detect when movieclip inside frame "moving" end ?
Use the undocumented addFrameScript() method, to add code to the last frame of your nested movieclip. And example function could be something like this:
nested_mc.addFrameScript(nested_mc.totalFrames - 1, function():void
{
nested_mc.dispatchEvent(new Event(CustomEvent.LAST_FRAME, true, true));
});
Dispatch an event on the last frame of the movieclip, with bubbling turned on. Listen for this event, then do what you need to do in the handler.
The first parameter of addFrameScript is the frame number, but it is zero based. That is the reason for the -1.
精彩评论