-
Stopping an MC?
A vairable is set that is the frame that I need an MC to stop on.
How can I make it so that the MC keeps playing through and when the variable gets set, it plays through the animation and just stops on that frame. So if the stop frame is 5 and when the var is generated the mC is on frame 6, the MC wont just jump to frame 5, it will play through 6-30 then 1-4 and stop on 5...
Thanks
-
Teacosy is coming
You could add an event listener that checks the MC's current frame each frame, and then if the current frame matches the number in the variable, then stop on that frame.
-
okay, how would I go about doing that?
-
PHP Code:
// frame 1
addEventListener(Event.ENTER_FRAME, checkFrame);
var targetFrame:int = 0;
function checkFrame(e:Event):void{
if(currentFrame == targetFrame) stop();
}
// frame 5
targetFrame = 6;
// frame 6
// :)
-
Teacosy is coming
If you want to use that code on a MC you would need to do
myMC.addEventListener(...
and then in the function do
if(e.target.currentFrame == targetFrame) stop();
The code neznein posted is the the main timeline.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|