6.7 Class types

A class refers to a type or a value depending on its use.

class A 
{
    static var x
    var y
    prototype var z
}
var a : A  // A means type A
a = new A  // A means value A


The value is a class object that has the form shown in the drawing above. The class object is CA. When used as a type, it evaluates to its instance traits (TA). When used in a new expression, the class serves as a factory object with a special method that creates a new instance (OA), which contains an internal delegate property pointing to the class object's prototype (P) and an internal traits property pointing to the class object's 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_specification59.html