all groups > flash actionscript > march 2006 >
You're in the

flash actionscript

group:

Script play does not loop



Script play does not loop ronhawker
3/1/2006 10:17:08 PM
flash actionscript: I have a short script for starting and stopping a movie with buttons as follows:

// This script takes the user to Scene 2 when goScene_btn is released
start_btn.onRelease = function() {
play();
};
// This script takes the user to Scene 2 when goScene_btn is released
stop_btn.onRelease = function() {
stop();
};

If I put a stop(); at the top then it starts as not running; however, if I
then click the start_btn it runs but only does one loop and stops. If I don't
put the stop(); then it runs when it stops and works correcting with the start
and stop buttons after the first stop. The next start release will play the
movie and it does not stop but loops.

What do I need to change in the script to get it to not run when loaded but
run continuously until stopped by the stop button and then restart again
several times based on used clicks.
Re: Script play does not loop ronhawker
3/1/2006 11:05:40 PM
Ok, that makes sense. Now how do you stop the movie on-load so you can have the
user use the start button to start the movie. My code thoughts are to use an
onpageload function for the stop or something similar that only works at first
after the clip is first loaded. What is the syntax for that in Flash.
Re: Script play does not loop Jeckyl
3/2/2006 12:00:00 AM
Make the loop go from frame 2 until the end, not frame 1

Then after the last frame put another frame that has "gotoAndPlay(2)"
--
Jeckyl

Re: Script play does not loop Jeckyl
3/2/2006 12:00:00 AM
if you put a stop on the first frame, then when it tries to loop, it goes
back to the first frame and sees a stop
--
Jeckyl

Re: Script play does not loop ronhawker
3/2/2006 3:35:05 PM
AddThis Social Bookmark Button