/3/ clip event loops

the enterFrame event handler
  1. Select Insert>>New Symbol to create a blank movie clip symbol.
  2. Name the clip symbol process.
  3. Return to the main movie timeline and create a layer called processMove.
  4. On the processMove layer, place an instance of the process symbol.
  5. Select the process instance and attach the following code:
    onClipEvent (enterFrame) {
      _root.ball._x += 10;
    }
make clip event loops more flexible
  1. Select Insert>>New Symbol twice to create two blank movie clip symbols.
  2. Name one clip symbol process, and the other eventLoop.
  3. In the library, select the process clip, then select Options>>Linkage. The Symbol Linkage Properties dialog appears.
  4. Select Export this symbol.
  5. In the identifier box, type processMoveBall and then click OK.
  6. On frame 1 of the process clip, place an instance of eventLoop.
  7. Select the eventLoop instance, and attach the following code to it:

    onClipEvent (enterFrame) {
      _root.ball._x += 10;
    }
  8. Return to the main movie timeline and attach the following code to a "start move" button:
    on (release) {
      attachMovie("processMoveBall", "processMoveBall", 5000);
    }
  9. Attach the following code to a "stop move" button:
    on (release) {
      removeMovieClip(processMoveBall);
    }