Flash CS3 Documentation |
|||
| Flash Lite 2.x ActionScript Language Reference > ActionScript classes > Object > __proto__ (Object.__proto__ property) | |||
public __proto__ : Object
Refers to the prototype property of the class (ActionScript 2.0) or constructor function (ActionScript 1.0) used to create the object. The __proto__ property is automatically assigned to all objects when they are created. The ActionScript interpreter uses the __proto__ property to access the prototype property of the object's class or constructor function to find out what properties and methods the object inherits from its superclass.
The following example creates a class named Shape and a subclass of Shape named Circle.
// Shape class defined in external file named Shape.as
class Shape {
function Shape() {}
}
// Circle class defined in external file named Circle.as
class Circle extends Shape{
function Circle() {}
}
The Circle class can be used to create two instances of Circle:
var oneCircle:Circle = new Circle(); var twoCircle:Circle = new Circle();
The following trace statements show that the __proto_ property of both instances refers to the prototype property of the Circle class.
trace(Circle.prototype == oneCircle.__proto__); // Output: true trace(Circle.prototype == twoCircle.__proto__); // Output: true
prototype (Object.prototype property)
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00005392.html