How to Program in Flash (Basic Actionscript 2.0)

Know your Flash version., Understand what a programming language is., Understand we will be using ActionScript 2., Now that we've laid some ground rules, we can begin with a basic script., A dialog should pop up., Double-click the button., In the...

13 Steps 2 min read Medium

Step-by-Step Guide

  1. Step 1: Know your Flash version.

    Anything at or above Flash 7 (Not CS7, just 7; all CS Flash versions should work) should be able to handle what we will cover here.
  2. Step 2: Understand what a programming language is.

    A programming language is an intermediate language between humans ("Hey, what's up") and computers (10111010001000x101110001110).

    Let's say you met someone who didn't speak English, and spoke Spanish.

    If you both knew French, you can communicate, just not the way you naturally would. , ActionScript is the programming language for Flash.

    ActionScript 1 is outdated and ActionScript 3 is too complex for a short LifeGuide Hub article. , Open a new project in Flash, making sure it's ActionScript
    2.

    Using the drawing tools, draw a simple button on the screen.

    Highlight it with the mouse (the selection tool), right click, and click "Convert to Symbol".

    You can also press F8 with the button selected. , Just set the type as button and click OK for now.

    Note that it pops up in the Library. , In the timeline, use Insert Keyframe to put in a little box in the rows labeled Up, Over, Down, and Hit.

    You can mess with these on your own time, just make sure there is a button in up and hit, at minimum.

    On the top of the stage, click Scene 1 to return. , on the middle.

    This isn't really important and is only for reference.

    You can put anything on the second frame. , With the first frame selected, press F9 or right-click, and click Actions.

    In the window that appears, type "stop();" without the quotation marks.

    When this runs, the movie will stop on the first frame (to avoid bugs in the future you may want to do this to Frame 2 as well). , Type in: on (release) {     gotoAndStop(2); } This tells Flash when your mouse button releases over the button, you want the timeline to go to Frame 2 ("YAY!") and stop there, if you didn't type that in for Frame
    2.

    You can also use gotoAndPlay to trigger an animation, but that's more advanced. , Click the button.
  3. Step 3: Understand we will be using ActionScript 2.

  4. Step 4: Now that we've laid some ground rules

  5. Step 5: we can begin with a basic script.

  6. Step 6: A dialog should pop up.

  7. Step 7: Double-click the button.

  8. Step 8: In the timeline

  9. Step 9: insert another frame and use the text tool to write "YAY!"

  10. Step 10: We can begin scripting now.

  11. Step 11: Now that your frames are coded

  12. Step 12: open the Actions window for the button the same way you did with the frame.

  13. Step 13: Press Ctrl + Enter to run your movie (Cmd + Return on Macs).

Detailed Guide

Anything at or above Flash 7 (Not CS7, just 7; all CS Flash versions should work) should be able to handle what we will cover here.

A programming language is an intermediate language between humans ("Hey, what's up") and computers (10111010001000x101110001110).

Let's say you met someone who didn't speak English, and spoke Spanish.

If you both knew French, you can communicate, just not the way you naturally would. , ActionScript is the programming language for Flash.

ActionScript 1 is outdated and ActionScript 3 is too complex for a short LifeGuide Hub article. , Open a new project in Flash, making sure it's ActionScript
2.

Using the drawing tools, draw a simple button on the screen.

Highlight it with the mouse (the selection tool), right click, and click "Convert to Symbol".

You can also press F8 with the button selected. , Just set the type as button and click OK for now.

Note that it pops up in the Library. , In the timeline, use Insert Keyframe to put in a little box in the rows labeled Up, Over, Down, and Hit.

You can mess with these on your own time, just make sure there is a button in up and hit, at minimum.

On the top of the stage, click Scene 1 to return. , on the middle.

This isn't really important and is only for reference.

You can put anything on the second frame. , With the first frame selected, press F9 or right-click, and click Actions.

In the window that appears, type "stop();" without the quotation marks.

When this runs, the movie will stop on the first frame (to avoid bugs in the future you may want to do this to Frame 2 as well). , Type in: on (release) {     gotoAndStop(2); } This tells Flash when your mouse button releases over the button, you want the timeline to go to Frame 2 ("YAY!") and stop there, if you didn't type that in for Frame
2.

You can also use gotoAndPlay to trigger an animation, but that's more advanced. , Click the button.

About the Author

H

Hannah Kelly

Experienced content creator specializing in organization guides and tutorials.

73 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: