How to Learn Flash Action Script 3

How to Learn Flash Action Script 3 thumbnail
Basic ActionScript commands.

Learning Flash ActionScript will open career opportunities and expand your Flash animation design capabilities. Although you can do impressive Flash animations without ActionScript, a knowledge of ActionScript will minimize the time required to create Flash animations. As well, ActionScript skills will let you more easily create other types of computer programs such as business, educational and engineering programs. Most importantly, a few simple ActionScript commands will greatly expand your ability to control your animation.

Things You'll Need

  • Adobe Flash Professional, CS3, CS4 or CS5 versions
  • Computer with 1 GByte memory
Show More

Instructions

    • 1
      Create a Flash file.
      Create a Flash file.

      Start Adobe Flash Professional. Select ActionScript 3.0 from the version options on the opening screen.

    • 2
      Insert frames and text.
      Insert frames and text.

      Insert 10 keyframes on the timeline's layer. Select the layer, layer1, on the timeline. Position the mouse over the layer's first frame. Select "Insert>Timeline>Keyframe." Repeat this action 10 times to insert 10 frames.

      Open the drawing and text panels. Select "Window>Tools." Now open the timeline panel. Select "Window>Timeline."

      Place a number on the stage for each Keyframe inserted. Position the mouse over the first frame in the timeline. Depress the mouse button to select the first frame. Select the text tool from the tool bar with your cursor and mouse. Now, position the cursor over the stage. Depress the mouse button. Type the number 1 into the textbox that appears. Repeat this procedure for each of the nine other frames. Type the number of the frame in the textbox on the stage for each frame inserted.

      Set the frame rate to 1 frame per second. Use the fps textbox within the timeline panel.

      Now test the movie. Use the menu bar sequence: Control>Test Movie. Observe that the movie sequences through all the graphics placed in each of the frames.

    • 3
      Create an actions layer.
      Create an actions layer.

      Create another layer on the timeline and label it Action. Select the new layer icon within the timeline panel. Position the mouse cursor over the new layer icon and depress the mouse button. Now position your mouse cursor over the new layer icon, layer 2. Depress the mouse button, select the layer's label and delete it. Now type into the layer text box the new label, Action.

    • 4
      Enter and execute ActionScript commands.
      Enter and execute ActionScript commands.

      Position the mouse cursor over frame 1 on the action layer in the timeline. Depress the mouse to select frame 1. Open up the action's editor (Window>Actions). Type goToandPlay (5) on the first line in the actionscript editor.

      Test the movie (Control>test movie). Observe that the movie skips the first 4 frames, but sequences through frames 5 through 10. Go back to frame 1, enter the actions editor and delete the command gotoAndPlay().

      Select frame 5 on the Actions layers, select actions (Window>Action) and type in the action editors the command, stop(). Play the movie again and observe that the movie stops abruptly at frame 4 and displays the number 4. Now go back to frame 5, open the actionscript editor and delete the stop command. Type in the command gotoAndStop(9) in the Action editor and test the movie(Control>Test Movie) and observe the effect.

Tips & Warnings

  • Use keyframes for the frame type for each frame that has ActionScript code within it. This will keep code on a previous frame from overwriting ActionScript code on a subsequent frame. A separate action layer should always be created and used solely for entering ActionScript code into.

  • The frame-per-second setting made within the fps textbox in the timeline window is critical for viewing your movie correctly. If the frame-per-second rate is too high, you will not be able to see the graphics that Flash displays for each frame. Generally, keep your frame rate below 24 frames per second.

  • Most ActionScript coding errors are because of typographical errors. Always check your code for typos. Remember that ActionScript is case sensitive. The first thing you should do, if you are a novice, when a compiler or syntax error code occurs is to proof the code. A command that is not capitalized correctly will result in a syntax error or a compiler error. Other common typographical ActionScript errors involve the misplacement or the accidental exclusion of parenthesis, braces and brackets.

Related Searches:

References

  • Photo Credit commande image by Dominique LUZY from Fotolia.com file folders image by Kathy Burns from Fotolia.com video film image by Oleg Verbitsky from Fotolia.com action image by NL shop from Fotolia.com remote contorl and shower on table image by .shock from Fotolia.com

Comments

You May Also Like

Related Ads

Featured