Sunday, April 24, 2011

Play Timeline Frames in Reverse

  1. First you have to declare a boolean variable reverse (2 values, either true or false).
  2. Then add event listeners for mouse over, mouse out and enter frame events to the button instance box_01.
  3. When the mouse pointer is on the button, reverse value is set to true.
  4. When the mouse pointer is NOT on the button, reverse value is set to be false.
  5. Event.ENTER_FRAME executes the run function continuously. It executes the run function 30 times per second if the frame rate is 30 fps.
  6. run function continuously checks if the reverse value is true or false.
  7. It goes to the previous frame when reverse is true and it goes to the next frame when reverse is false.
  8. You may see how the timeline pointer goes in bandwidth profiler while testing this movie.
  9. Check below image for reference.