ActionScript 3 Language Specification |
|||
| ActionScript 3.0 Language Specification > 9 Classes > 9.2 Class objects > 9.2.2 Traits | |||
Properties of a class definition are represented as traits of the class object and its instances. Think of a trait as a fixed property that is shared by all instances of a type. Class objects (CA) are special in that they are a single instance with an internal type with a corresponding set of traits (TCA). The internal type of a class object describes the static properties of the class definition. The instance traits (TA) are shared by all instances created by the class object. They correspond to the instance properties of the class definition.
class A
{
static var x
var y
}
In this example, the definition for x contributes a trait to the class traits (TCA), and the definition of y contributes a trait to the instance traits (TA).
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification73.html