Control a Timeline with Mouse Position

Clean Up The ActionScript

Ok, let's start to clean up the ActionScript, starting with that trace(); function. If you're like me, you are slightly annoyed when the Output window pops up every time you test your movie. So, select that line of code and Delete it:

Now rearrange the rest of the code so it's in a more "acceptable" order.

  1. First, we like to declare variables at the very start of the script
  2. Then we call the init function (Really! Call it before you define it, as strange as that seems)
  3. Next we define the init function
  4. Finally, run the onEnterFrame loop