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);     }

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy