Thank you for the tips @ClayUUID. You got me on the right track. After making the adjustments you suggested, the loop works as expected.
/*defined i=0 in first frame
placed this.gotoAndPlay("restart"); on last frame
placed "restart" label on first frame */
if (i < 3) {
i++;
} else if (i == 3) {
this.stop();
}
ClayUUID Nov 15, 2016 8:28 PM (in response to Tony Dilger)
ANSWER!
You initialize i to zero every time you enter the frame.
The variable i only exists in that frame.
The conditional logic doesn't account for i being equal to 2.
There's no such function as .play().
There's no need to use a frame label when you're just advancing to the next frame.