PDA

View Full Version : Quick (hopefully) newbie question.


user952
03-01-2003, 07:57 PM
Hi. I'm very new to flash and action script... Here's what I want to do:
On page load play and loop some frames
On press of a button stop the first action and play a different set of frames
On second press of the same button play third set of frames or simply start the original set again

Sort of like a tv.

Does that make sense?

Where do I place the button? What about the action script? I'm pretty clue less...

Thanks.

jaybee
03-01-2003, 08:12 PM
set up your movie so that you have a named frame followed by the content then code on the last frame that says "go back and play this again"...so like this for example:


//frame1
playing = 1;

//frame2 labelled *prog1*
....
//frame10
gotoAndPlay("prog1");

//frame 11 labelled *prog2*
...
//frame 20
gotoAndPlay("prog2");

//frame21 labelled *prog3*

...
//frame30
gotoAndPlay("prog3");


then put a button on it's own layer across the whole timeline with the action on it:


on (release) {
if (playing == 3) {
playing = 1;
} else {
playing++;
}
gotoAndPlay("prog"+playing);
}

Ricod
03-02-2003, 10:53 AM
Welcome to the board user952 !

To make it easier on everybody, please use more descriptive thread titles. "I have a question" or "Can someone help me" isn't very informative. Thank you for your cooperation and enjoy your stay here ! I hope you learn a couple of things here. :)

user952
03-02-2003, 05:55 PM
Thanks for the help. I'm going to try it soon.

You're right about the thread title too... :o :)