Task: Your First Script

I l @ ve RuBoard

  1. Create a new movie.

  2. Place three key frames in the movie by pressing F7 twotimes with the timeline selected.

  3. Use your Flash drawing skills to create different graphics on each frame. For example, you could place a 1 on the first frame, a 2 on the second frame, and a 3 on the third frame.

  4. Now if you run the movie by choosing Control, Test Movie, you will see the movie loop through the three frames.

  5. Return to the main timeline and select the second key frame. Press F2 to bring up the Actions panel.

  6. The left side of the Actions panel shows an expandable list of keywords. Find the stop keyword and double-click it. You will find it under Actions, Movie Control. Now the script window should contain one line that looks like this:

     stop (); 
  7. Close the Actions window and choose Control, Test Movie to run the movie again. You can also press Command+Return on the Mac or Control_Enter in Windows. It should show you frame 1, frame 2, and then stop. You'll never see frame 3.

    ActionScript has taken control. You've created your first script and thwarted Flash's intentions of looping through all three frames.

I l @ ve RuBoard

Sams Teach Yourself Flash MX ActionScript in 24 Hours
Sams Teach Yourself Flash MX ActionScript in 24 Hours
ISBN: 0672323850
EAN: 2147483647
Year: 2002
Pages: 272

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net