flash CS3 question..
- Started
- Last post
- 3 Responses
- krisscott21
I'm not a flash user but I'm learning on the job. so question:
How do you loop an animation a specific number of times (3 in this case) and then have it stop at a specific key frame (the first one in this case)
I input:
var noOfLoops = 3;
if (loop == undefined) {
loop = 1;
} else {
loop++;
if (loop == noOfLoops) {
stop();
}
}in the last key frame.. so it runs 3 times and stops. but I want it to run 3 times and then stop on the first frame.
I'm sure this is a fairly easy thing, I jut thought I'd ask here and save some time.
- lvl_130
frame 1:
var loopNumber = 0;frame where you want it to check to either continue or stop:
loopNumber++;
if (loopNumber < 3) {
gotoAndPlay(136);
} else {
stop();}
- change frame 136 to whatever your frame is obviously.lvl_13
- got it..
dankekrisscott21 - no problemlvl_13
- ifeltdave0
or, if its simple animation.... set its behavior on the timeline in the properties to "graphic", choose "loop" from the drop down next to the instance box and enter "3" in the field for number of loops. No coding necessary :)
- noRGB0
if (!loopCount) {
var loopCount:Number = 0;
}loopCount++;
if (loopCount >= 3) {
this.stop();
}