EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 806

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
806 Terminology
Functions are blocks of reusable code that can be passed parameters and can return a value.
For more information, see About functions and methods” on page 201.
Function literals are unnamed functions that you declare in an expression instead of in a
statement. Function literals are useful when you need to use a function temporarily, or to use
a function in your code where you might use an expression instead.
IDE refers to an “integrated development environment,” which is an application in which a
developer can code, test, and debug applications in an interactive environment. The Flash
authoring tool is sometimes called an IDE.
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 contain all the properties and methods of a particular class. For
example, all arrays are instances of the Array class, so you can use any of the methods or
properties of the Array class with any array instance.
Instance names are unique names that let you target instances you create, or movie clip and
button instances on the Stage. For example, in the following code, “names” and
studentName” are instance names for two objects, an array and a string:
var names:Array = new Array();
var studentName:String = new String();
You use the Property inspector to assign instance names to instances on the Stage. For
example, a master symbol in the library could be called
counter and the two instances of that
symbol in the SWF file could have the instance names
scorePlayer1_mc and
scorePlayer2_mc. The following code sets a variable called score inside each movie clip
instance by using instance names:
this.scorePlayer1_mc.score = 0;
this.scorePlayer2_mc.score = 0;
You can use strict data typing when creating instances so that code hints appear as you type
your code.
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. For a list of keywords, see About keywords” on page 138 and About
reserved words on page 139.
Literals represent values that have a particular type, such as numeric literals or string literals.
Literals are not stored in a variable. A literal is a value that appears directly in your code, and is
a constant (unchanging) value within your Flash documents. Also see function literal, and
string literal.

Table of Contents

Related product manuals