MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 82

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Using strict data typing helps ensure that you don't inadvertently assign an incorrect type of
value to a variable. Flash checks for typing mismatch errors at compile time, and displays an
error message if you use the wrong type of value. Therefore, using strict typing also helps to
ensure that you do not attempt to access properties or methods that are not part of an object's
type. Strict data typing means the ActionScript editor automatically shows code hints
for objects.
For more information on creating variables, see
information on naming variables, see
information on assigning data types, and the types you can assign, see
on page
82.
You can find a sample source file, datatypes.fla, in the Samples folder on your hard disk,
which shows you how to use data types in an application.
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\DataTypes.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/DataTypes.
Assigning a data type
You need to assign data types whenever you define a variable, whether you declare a variable
using the
keyword, create a function argument, set function return type, or define a
var
variable to use within a
which means you follow the variable name with a colon and then the data type:
var my_mc:MovieClip;
There are many possibilities for data types, ranging from the native data types such as
Number, String, Boolean, or built-in classes that are included in Flash Player 8, such as
BitmapData, FileReference, or even custom classes that you or other developers have written.
The most common types of data types you might need to specify are the built-in data types
such as Number, String, Boolean, Array, or Object, which are shown in the following
code examples.
82
Data and Data Types
"About naming variables" on page
or
loop. To assign a data type, you use post-colon syntax,
for
for..in
"About variables" on page
86. For
91. For more
"Assigning a data type"

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents