Requirements
- Flash 5 or higher. (Tutorial done in Flash 8, button appearances may be different in previous versions)
1. Start by creating a new document in Flash.
2. Press F9 to open the Actions Panel of your movie.
3. You will notice some of the buttons are grayed out, they will be selectable when you type some code.
4. Type the following code into the Actions Panel.
| var num = 5; |
5. This code creates a variable that holds the number 5 in it. You will learn more about variables in later tutorials.
6. After typing this code you should see that all of the Actions Panel buttons have been enabled.
7. The plus button is an easy way to add code to your movie.
8. Pressing it and selecting Global Functions > Timeline Control > gotoAndStop will add the code
| gotoAndStop(); |
9. You will be able to enter in a frame number or frame label or a scene name with a frame number into the parenthesis depending on what you want the code to do.
10. If you press the Show code hint button (It looks like a left parenthesis and a speech bubble) you can see what you need to put in the parenthesis for the script to work.
11. You can put a 1 into the parenthesis for now.
12. If you select the Script Assist button you will get a helpful tool for when you are not sure how a part of Actionscript works.
13. You can change the type to Frame Number, Frame Label, Expression, Next Frame, or Previous Frame.
14. Where it says Frame: you can enter the frame number or label that you want your code to go to.
15. To close the Script Assist just press the Script Assist button again.
16. Another useful feature in the Actions Panel is the Help tool.
17. If you select gotoAndStop without selecting the parenthesis and click on the Help button (A Question Mark, or a book in older versions of Flash) you will get a small tutorial showing you how to use that function. This can be very useful if you are unsure on what a function does or how it is used.
18. You can also search the help for any function or idea that you need help with.
19. One other thing to note in this tutorial is that if you click on the pop-up menu in the Actions Panel (It looks like a bulleted list in the top right corner).
20. There are many options in here that you can experiment with, if you click on preferences you can change the font settings for your code to make it easier to read.
21. That's it for this introduction to ActionScript.





