#12002/3/14 11:59:35
Dog = function( )
{
this.instNum = ++this.constructor.count;
}
// these next two properties aren't really part of the 'constructor'
Dog.count = 0; // used to count how many Dogs have been created
Dog.className = "Dog"; // used to remember the name of the class
rover = new Dog( );
fido = new Dog( );
trace( rover.instNum ); // 1 (first Dog created)
trace( fido.instNum ); // 2 (second Dog created)
trace( rover.constructor.className ); // Dog
这里用到的 constructor 在 flashmx 还是 undocument 阿。