0
votes

I was making an animation in flash cs4 and i was making a play/pause button. Everything pauses when clicked but the play button gives me an issue. I have some movie clips with animations in them so when i tell them to play, instead of resuming where they were, they play regardless of whether or not they should be playing. Is there a way to fix this?

3
Can you post your fla somewhere? - citizen conn
Well I'd rather not because its important and confidential. - Globmont
Ok, its just very hard to troubleshoot without knowing the structure of your document. Most likely you just need to keyframe more appropriately... - citizen conn
What exactly do you mean by that and sorry I can't post the .fla. Is there like a command in as3 that will completely pause everything in the whole animation and completely resume everything. Like stop and resume the thread? - Globmont
No there's not. Its all a matter of how your movieclips are organized. Try doing it with a very simple animation first and then work from there. - citizen conn

3 Answers

1
votes

you could try recursively going though all the movieclips in a moveclip and stoping them, from there modifiying the below's link source to play wouldn't be too bad either.

http://www.auricom.com/devote/using-recursion-to-perform-an-action-on-all-displayobject-children

one thing in the the above link, is if there is a sprite with a movieclip his code wouldn't traverse into a the sprite, here is a small mod for his code to catch that:

private function stopAllMovieClips(mc:*) : void {

        trace("Stop: ", mc.name);

         if(mc is MovieClip) mc.stop();

         for (var i:int = 0; i < mc.numChildren; i++) 
         if (mc.getChildAt(i) is DisplayObjectContainer){  /// here is the mod
                      stopMovieClip(mc.getChildAt(i));
                 }

}

stopAllMovieClips(this);
0
votes

Depending on what you're trying to accomplish, you may want to switch your movie clips to graphics.

A movie clip object will play on its own, completely ignoring whether its parent is playing or stopped. A graphic, on the other hand, will only play when its parent is playing, and in fact is locked to its parent's timeline. That is, if you have the parent go back one frame, the graphic will go back a frame as well.

0
votes

If you want resume option, just do simple work.

  • While pausing catch the frame number into a number

If mc is your movieClip,

>   mc.stop();<br> var
> mcFrameNumber:Number = mc.currentFrame;
  • Then when playing again,use
mc.gotoAndPlay(mcFrameNumber);

It will work.