0% found this document useful (0 votes)
38 views

Flash Action Scriptx

Flash allows adding interactivity through buttons, menus, and ActionScript code. ActionScript is the scripting language that controls Flash movies and adds interactivity. It includes elements like actions, events, expressions, and objects. To add actions in Flash, they must be attached to buttons, movie clips, or frames through the Actions panel.

Uploaded by

marizamora
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Flash Action Scriptx

Flash allows adding interactivity through buttons, menus, and ActionScript code. ActionScript is the scripting language that controls Flash movies and adds interactivity. It includes elements like actions, events, expressions, and objects. To add actions in Flash, they must be attached to buttons, movie clips, or frames through the Actions panel.

Uploaded by

marizamora
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Learning Flash Actionscript

Flash Interactions

User interactions can be added to control the animations or Flash movies.

Flash Interactive Buttons

Buttons can be clicked to perform some task like starting or stopping a movie. Buttons can also
be animated on the interaction. Menus are forms of buttons used for Web navigation.

Flash ActionScripts

ActionScript, the scripting language of Macromedia Flash MX, lets you add interactivity to a
movie and allows you to create a movie that behaves exactly as you want.

Like other scripting languages, ActionScript follows its own rules of syntax, reserves keywords,
provides operators, and allows you to use variables to store and retrieve information.
ActionScript includes built-in objects and functions and allows you to create your own objects
and functions.

ActionScript provides elements, such as actions, operators, and objects, that you put together in
scripts that tell your movie what to do; you set up your movie so that events, such as button
clicks and keypresses, trigger these scripts. For example, you can use ActionScript to create
navigation buttons for your movie.

To add an action to a Flash document, you must attach it to a button or movie clip, or to a
frame in the Timeline. The Actions panel allows you to select, drag and drop, rearrange, and
delete actions.

A. Writing and Editing ActionScript

As with other scripting languages, ActionScript follows its own rules of syntax, reserves keywords,
provides operators, and lets you use variables to store and retrieve information.
ActionScript includes built-in objects and functions and lets you create custom
objects and functions.

Actions panel or Script window

About the Actions panel

You use the Actions panel to create ActionScript in


a Flash document (FLA file).

The Actions panel consists of three panes: (1)


Actions Toolbox (2) Script navigator (3) Script pane,
each of which supports you in creating and
managing scripts.
ActionScript terminology
Like any scripting language, ActionScript uses its own terminology.

Actions are statements that instruct a movie to do something while it is playing. For example,
gotoAndStop sends the playhead to a specific frame or label.

Events are actions that occur while a movie is playing. For example, different events are
generated when a movie clip loads, the playhead enters a frame, the user clicks a button or
movie clip, or the user types at the keyboard.

Event handlers are special actions that manage events such as mouseDown or load. There are
two kinds of ActionScript event handlers: actions and methods. There are only two event
handler actions, on and onClipEvent. In the Actions toolbox, each ActionScript object that has
event handler methods has a subcategory called Events.

Expressions are any legal combination of ActionScript symbols that represent a value. An
expression consists of operators and operands. For example, in the expression x + 2, x and 2 are
operands and + is an operator.

Identifiers are names used to indicate a variable, property, object, function, or method. The first
character must be a letter, underscore (_), or dollar sign ($). Each subsequent character must
be a letter, number, underscore, or dollar sign. For example, firstName is the name of a variable.

Instances are objects that belong to a certain class. Each instance of a class contains all the
properties and methods of that class. All movie clips are instances with properties (for example,
_alpha and _visible) and methods (for example, gotoAndPlay and getURL) of the MovieClip
class.

Instance names are unique names that allow you to target movie clip and button instances in
scripts. You use the Property inspector to assign instance names to instances on the Stage.

Keywords are reserved words that have special meaning. For example, var is a keyword used to
declare local variables. You cannot use a keyword as an identifier. For example, var is not a
legal variable name.

Methods are functions assigned to an object. After a function is assigned, it can be called as a
method of that object.

Operators are terms that calculate a new value from one or more values. For example, the
addition (+) operator adds two or more values together to produce a new value. The values
that operators manipulate are called operands.

Parameters (also called arguments) are placeholders that let you pass values to functions.

Properties are attributes that define an object. For example, _visible is a property of all movie
clips that defines whether a movie clip is visible or hidden.

Variables are identifiers that hold values of any data type. Variables can be created, changed,
and updated. The values they store can be retrieved for use in scripts. In the following example,
the identifiers on the left side of the equal signs are variables:

You might also like