1. Computing

Flash Tip: ActionScripting Basics: "On" Command Options

By

One of the most frequently used commands in Flash ActionScripting is the on command. This command controls user interactivity through mouse events; when a particular mouse action is performed, it triggers a Flash event in response to it depending on the commands defined inside the on event. (For instance, in Flash Lesson 11 we used an on event to tell Flash to go to a certain scene and play it when the user clicked and then released on a button.)

You can find the on command in your Actions panel, under Actions->Movie Controls. Flash uses parameters to control which mouse event triggers the actions defined in your script; the most common is the on (release) parameter, because it mimics typical browsing actions where a link is opened not immediately upon clicking, but after the finger is relaxed to release the click.

Rather than write the code yourself, you can select the commands using the checkboxes/fields and let Flash do all the work. You can select multiple instances so that the commands will be performed at any one of multiple events, or only choose one. If you select more than one then the parameters will be separated by a comma. Continue for a breakdown of all of the parameters.

©2014 About.com. All rights reserved.