PDA

View Full Version : Pausing movie


infiniti
05-24-2004, 02:00 AM
I am having some trouble creating a pause button for my movie. Basically, my main timeline has several movie clips, there's some animation within each movie clip and some movie clips have children movie clips. What I want is to pause at an exact frame and there will be a button to resume at current paused position. Just like a regular pause button.

So I had the idea to make a mc spit out a variable that tells me it is currently playing, but with my setup this gets really messy, especailly with several children movie clips.

I saw this hack solution which makes a new printjob instance and it does the pausing perfectly. Apprarently this is a stupid way to pause the movie, so I am looking for a similar function that can allow the pause w/o prompting a window, ie. not a hacked solution! Thanks in advanced!

Hacked Way:



function pauseMovie()
{
var p = new PrintJob();
p.start();
}

function onKeyDown()
{
switch(Key.getCode()){
case 80: // p key
pauseMovie();
break;
case 19: // pause/break key
pauseMovie();
break;
}
}

Key.addListener(this);