0
votes

I have an Flash action script 3 problem. This is my code

import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.ui.Mouse;

PlayButton.addEventListener(MouseEvent.CLICK, playButtonClick);
PauseButton.addEventListener(MouseEvent.CLICK, pauseButtonClick);

function playButtonClick(event_object:MouseEvent){
    var currFrameP = MovieClip(root).currentFrame;
    trace("Frame play = " + currFrameP);
    MovieClip(root).StoryLine1.gotoAndPlay(currFrameP);
}


function pauseButtonClick(event_object:MouseEvent){
    var currFrameS = MovieClip(root).currentFrame;
    trace("Frame pause = " + currFrameS);
    MovieClip(root).StoryLine1.gotoAndStop(currFrameS);
}

When i press Pause Button the movie stops ... but still goes in the background. Why i say that? Because when i hit Play the movie doesn't resume where was paused. He will resume as the movie was still playing. Can someone tell me how to pause and resume the movie like a normal behavior. Thanks

1
I'm finding it hard to tell which movie(or stage?) you want to play, and what exactly you are seeing. - Daniel
It should be MovieClip(root).StoryLine1.currentFrame. Or better enough keep a ref to the StoryLine1 object and use that to get and set frame. - Mohammad Haseeb

1 Answers

0
votes

Why do you need to get the current frame to stop or play? You should just be able to call play() etc.

I mean, if the clip is already at currentFrame (it is), then there's no need to go to that frame to start playing.