Static Statement - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Parameters
variableString:String
parameter.
expression
Example
In the following example, you assign a value to a variable. You are assigning the value of
to the
"Jakob"
name
set("name", "Jakob");
trace(name);
The following code loops three times and creates three new variables, called
, and
caption1
caption2
for (var i = 0; i < 3; i++) {
set("caption" + i, "this is caption " + i);
}
trace(caption0);
trace(caption1);
trace(caption2);
See also
var statement

static statement

class someClassName{
static var name;
static function name() {
// your statements here
}
}
Specifies that a variable or function is created only once per class rather than being created in
every object based on that class.
You can access a static class member without creating an instance of the class by using the
syntax
someClassName.name
static member using the instance, but only through a non-static function that accesses the
static member.
You can use this keyword in class definitions only, not in interface definitions.
Availability: ActionScript 2.0; Flash Player 6
Parameters
- The name of the variable or function that you want to specify as static.
name:String
226
ActionScript language elements
- A string that names a variable to hold the value of the
variable.
:
. If you do create an instance of the class, you can also access a
,
caption0

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF