PDA

View Full Version : "Play until frame [number]" is there a way to do this


big_dog45
04-12-2002, 11:20 PM
Alright here's what i'm trying to do

When the user pushes a button I want the movie to play a few frames before jumping to another frame.

I tried doing the following...

play() //note: the idea was that the movie would play four more
frames (the 4th one has a stop action) before jumping to
the next part of the movie.
gotoandplay(170)

unfortunately the movie jumps right away to frame 170...

Thanks for the help!!! I appreciate it!!!

JHallam
04-12-2002, 11:32 PM
Okay, this is off the top of my head;


//put on frame 1
function pause(start_time,pause_length){
while(getTimer() <= start_time + pause_length){
pause(start_time,pause_length);
}}

//this on the frame you want to pause, in your case frame 2
pause(getTimer(),2000);
// 2000 is 2000 milliseconds = 2 second pause)


That should work fine.

Thanks

mcdanyel
04-19-2002, 08:33 PM
I did something similar in a Flash App I built. Hardcore script people might laugh, but if you want your movie to play 4 frames then jump to frame 170 without putting a gotoAndPlay (170) line on frame 4 - put a conditional statement there to see if the correct button was clicked.

Use a "if" statement to check to see if a variable is true on not on frame 4 (or whatever frame you want the playhead to roll through before jumping), then on your button instance, tell it to set the variable to true when it is pressed. That way if the button is pressed the playhead rolls through until it hits the frame with the "if" statement on it then jumps, or if the button isn't pressed the playhead just rolls on down the timeline.