Web Analytics Made Easy -
StatCounter Looping frames (x - y) 'i' amount of times then proceeding to frames outside loop - CodingForum

Announcement

Collapse
No announcement yet.

Looping frames (x - y) 'i' amount of times then proceeding to frames outside loop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looping frames (x - y) 'i' amount of times then proceeding to frames outside loop

    Hi,

    I'm relatively new to Flash and have not done much work with the AS. I was hoping someone here could enlighten me on an area which has been stumping me.

    I need to know how to loop (for example) frames 1 to 5, 4 times then continue to frame 6 until the last frame, then go back to frame 1, thus re-entering the loop, etc. I do believe it would involve something like this... but then again I'm a newbie to this so... what do I know (which is why I wanna learn)

    Frame 1:
    i=0

    Frame 5:
    i=i+1
    if (i>4) {
    gotoAndPlay(6);
    } else if (i<4) {
    gotoAndPlay(1);
    }


    Thanks so much
    Reading your posts and not posting often...

  • #2
    My AS is very sketchy, but try changing i=i+1 to i+=1.
    They both mean the same thing, but I know for sure that the second one works in ActionScript 1 + 2.

    Andrew

    I take no responsibility for the above nonsense.


    Left Justified

    Comment

    Working...
    X