• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Loop Statements > Timeline and Clip Event Loops

8.7. Timeline and Clip Event Loops

The loops we've looked at so far cause the interpreter to execute blocks of code repeatedly. Most of your loops will be of this "ActionScript-statement" type. Sometimes it's desirable to create a timeline loop by looping Flash's playhead in the timeline. To do so, attach a series of statements to any frame; on the next frame, attach a gotoAndPlay( ) function whose destination is the previous frame. When the movie plays, the playhead will cycle between the two frames, causing the code on the first frame to execute repeatedly.

We can make a simple timeline loop by following these steps:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint