Local Variables
Local Variables of Base Type
In the Designer, it is possible to define variables that are local within an action script. These local variables are only known within the current action script.
Syntax |
| |
---|---|---|
Semantics | Declaring a local variable having the same type as the expression. | |
Substitutables |
| Any given name. |
| Expressions are object accessors, operation calls, boolean expressions, literals, etc. | |
Examples |
CODE
|
This enables the compiler to apply static type checking without requiring the modeler to put the static types into the action script.
Local Variables of Complex Type
Using local
, you can also create complex local variables by deriving the type from a given object.
Syntax |
| |
---|---|---|
Semantics | Creates a local variable of complex type usable within the action script. | |
Substitutables |
| Any given name. |
| Any valid action script expression that can be evaluated to a type. | |
Examples |
NONE
|
Local Arrays
Using local
, you can also create a local array. The type of the array elements is derived from an expression.
Syntax |
| |
---|---|---|
Semantics | Creates a local array using the array element declared after the equal sign. | |
Substitutables |
| Any given name. |
| Any valid action script expression that can be evaluated to a type. This is then the type of the array element. | |
Examples |
NONE
|
Related Pages:
Basics of the Action Script Language: