Flash CS5 Code Snippets and Instance Names - dummies

By Jennifer Smith, Christopher Smith, Fred Gerantabee

The addition of the new Flash CS5 Code Snippets panel to Adobe Flash Creative Suite 5 brings ActionScript within reach for many more users and provides precreated code fragments for most every common need.

The Code Snippets panel is a helpful way to get up and running, but when you’re ready to venture out on your own, you’ll find that coding using the Actions Panel’s Code Editor window may give you more flexibility for certain tasks.

All ActionScript code is added to keyframes on the timeline, and here you’ll add some common ActionScript statements within the Code Editor and with the assistance of the Actions Panel’s Script Assist mode.

Every time you need to add ActionScript to control a button (or a movie clip), you first need to create an instance name for the button. An instance name is a unique ID that tells ActionScript which object on the stage to control or work with. The Code Snippets panel automatically assigns an instance name to a selected button or movie clip when you apply a snippet. You can also add your own instance name by selecting the symbol instance and entering an instance name in the Property inspector.

Instance names can be assigned to buttons, movie clips, and certain text fields. Each instance name needs to be unique, even across several instances of the same symbol.