MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 36

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Object
An object is a collection of properties. Each property has a name and a value. The value of a
property can be any Flash data type, even the object data type. This allows you to arrange objects
inside each other, or nest them. To specify objects and their properties, you use the dot (
operator. For example, in the following code,
is a property of
employee
employee.weeklyStats.hoursWorked
You can use the built-in ActionScript objects to access and manipulate specific kinds of
information. For example, the Math object has methods that perform mathematical operations
on numbers you pass to them. This example uses the
squareRoot = Math.sqrt(100);
The ActionScript MovieClip object has methods that let you control movie clip symbol instances
on the Stage. This example uses the
mcInstanceName.play();
mc2InstanceName.nextFrame();
You can also create custom objects to organize information in your Flash application. To add
interactivity to an application with ActionScript, you'll need many different pieces of
information: for example, you might need a user's name, the speed of a ball, the names of items in
a shopping cart, the number of frames loaded, the user's ZIP Code, or the key that was pressed
last. Creating custom objects lets you organize this information into groups, simplify your
scripting, and reuse your scripts.
MovieClip
Movie clips are symbols that can play animation in a Flash application. They are the only data
type that refers to a graphic element. The MovieClip data type allows you to control movie clip
symbols using the methods of the MovieClip class. You call the methods using the dot (
operator, as shown here:
my_mc.startDrag(true);
parent_mc.getURL("http://www.macromedia.com/support/" + product);
Null
The null data type has only one value,
The
value can be used in a variety of situations. Here are some examples:
null
To indicate that a variable has not yet received a value
To indicate that a variable no longer contains a value
As the return value of a function, to indicate that no value was available to be returned by
the function
As a parameter to a function, to indicate that a parameter is being omitted
Undefined
The undefined data type has one value,
assigned a value.
36
Chapter 2: ActionScript Basics
hoursWorked
:
and
play()
. This value means "no value"—that is, a lack of data.
null
undefined
is a property of
method:
sqrt()
methods:
nextFrame()
, and is used for a variable that hasn't been
)
.
, which
weeklyStats
)
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents