Accessibility
Adobe
Sign in My orders My Adobe

Title

How to loop over some frames a given number of timesProducts affected

ActionScript makes it easy to count things. You can use a variable to count the number of times you pass through a frame.

For instance, to playback frames 10 through 20 five times, then the following Flash 4 ActionScript placed on frame 20 will accomplish that:

 Set Variable: "counter" = counter + 1     If (counter < 5)       Go To and Play (10)     End If 

In Flash 5, you can code the loop this way:

 counter++;     if (counter<5) {         gotoAndPlay (10);     } 


Doc ID
(tn_14023)

Last updated
2007-06-05

Products affected

Contacting Adobe Support

Still need help?
Find out about all your support options.
Contact support