ActionScript Programming/AS In A Nutshell

From Wikibooks, open books for an open world
Jump to navigation Jump to search

AS in a Nutshell[edit | edit source]

Setting up an ActionScript application[edit | edit source]

To get started coding in ActionScript 2.0 (or AS 2.0 for short which is how I will be referring to it from now on), start up the Flash MX 2004 or later program. Then create a New Flash Document. When your new Document comes up, go to where the Timeline is and click the first frame of Layer 1. Now open up the Actions panel by either clicking on the Actions pane on the bottom of the screen or going to the File menu and clicking Window>Development Panels>Actions. Anything you type in here will be run first when you run or test the Flash movie. Now let’s create a simple program.

Put this code into the Actions panel:

myName = "Robert"
trace("Hello " + myName);