ActionScript 3 Language Specification |
|||
| ActionScript 3.0 Language Specification > 9 Classes > 9.5 Class variables > 9.5.1 Static variables | |||
Variables declared with the static attribute add a slot trait to the class traits and a slot to the class object. Because there is only one class object per class, there is also only one slot per static variable. Static variables, like static methods, are not inherited, but are accessible from within the body of the class definition and through an explicit reference to the defining class's name. Static variables are in scope for all static and instance methods of the defining class and classes that inherit the defining class.
Static const variables must either have an initializer or be definitely unassigned before being set in the static initializer method.
|
NOTE |
|
Unlike in Java and C#, static variables are not inherited by derived classes and so cannot be referenced through derived class objects. |
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification86.html