Syntax Flashcards
can be thought of as a template or a blueprint for a type of object.
class
can include variables and constants, which hold data values, and methods, which are functions that encapsulate behavior bound to the class.
class definitions
The values stored in properties can be_or other objects.
These are numbers, strings, or Boolean values.
primitive values
contains a number of built-in classes that are part of the core language
ActionScript 3.0
All classes, whether built-in or user-defined, derive from the _ class
Object
Object data type is no longer the _ , even though all other classes still derive from it.
default data type
In ActionScript 2.0, the following two lines of code were equivalent because the lack of a type annotation meant that a variable would be of type Object:
var someObj:Object;
var someObj;
ActionScript 3.0, however, introduces the concept of untyped variables, which can be designated in the following two ways:
var someObj:*;
var someObj;
allow you to store values that you use in your program
Variables
To declare a variable, you must use the _ with the variable name.
var statement
the following line of ActionScript declares a variable named i:
var i;
Declaring a variable without designating the variable’s type is legal, but generates a compiler warning in _.
strict mode
You designate a variable’s type by appending the variable name with a _, followed by the variable’s type
colon (:)
the following code declares a variable i that is of type int:
var i:int;
You can assign a value to a variable using the assignment _.
operator (=)
the following code declares a variable i and assigns the value 20 to it:
var i:int; i = 20;
(or if more convenient)
var i:int = 20;
The technique of assigning a value to a variable at the time it is declared is commonly used not only when assigning primitive values such as integers and strings, but also when creating an _ or instantiating an instance of a class.
array
The following example shows an array that is declared and assigned a value using one line of code
var numArray:Array = [“zero”, “one”, “two”];
You can create an instance of a class by using the _ operator
new