Control a Timeline with Mouse Position

_xmouse and Tracing Variables

  1. Click Statements > User-Defined functions > function
  2. Type onEnterFrame in the Name box

  1. Click Statements > Variables > set variable
  2. The Variable name is xPos
  3. Type the Value _xmouse
  4. Select the Expression box

  1. Click Global Functions > Miscellaneous > trace
  2. Type xPos in the Message box
  3. Select the Expression box

Test your movie and have a look at the Output window (It should automatically pop up). You should see a stream of numbers pile up as you move the cursor left and right across the stage: