Previous | Next | Frames | No Frames |
Summary: Field | Property | Contructor | Method | Detail: Field | Property | Contructor | Method |
Field Summary | |
__proto__: Object | |
A reference to the prototype property of the object’s constructor function. | |
constructor: Object | |
A reference to the object’s constructor function. | |
static | prototype: Object |
Constructor | |
Object ( ) | |
Constructor; | |
Method Summary | |
addProperty ( name: String, getter: Function, setter: Function ): Boolean | |
Creates a getter/setter property. | |
hasOwnProperty ( name: String ): Boolean | |
isPropertyEnumerable ( name: String ): Boolean | |
isPrototypeOf ( theClass: Object ): Boolean | |
static | registerClass ( name: String, theClass: Function ): Boolean |
Associates a movie clip symbol with an ActionScript object class | |
toLocaleString ( ): String | |
toString ( ): String | |
Converts the specified object to a string and returns it. | |
unwatch ( name: String ): Boolean | |
Removes a watchpoint created with Object.watch() | |
valueOf ( ): Object | |
Returns the primitive value of the specified object | |
watch ( name: String, callback: Function, userData: Object ): Boolean | |
Registers an event handler to be invoked when a specified property of an ActionScript object changes. | |
var __proto__: Object |
A reference to the prototype property of the object’s constructor function. Refers to the prototype property of the constructor function that created myObject . 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 constructor function to find out what properties and methods the object inherits from its class.
|
var constructor: Object |
A reference to the object’s constructor function. The constructor property is automatically assigned to all objects when they are created using the constructor for the Object class.
|
static var prototype: Object |
|
Constructor; Creates an Object object and stores a reference to the object’s constructor method in the object’s constructor property.
|
|
|
Creates a getter/setter property. When Flash reads a getter/setter property, it invokes the get function, and the function’s return value becomes the value of prop . When Flash writes a getter/setter property, it invokes the set function and passes it the new value as a parameter. If a property with the given name already exists, the new property overwrites it. A “get” function is a function with no parameters. Its return value can be of any type. Its type can change between invocations. The return value is treated as the current value of the property. A “set” function is a function that takes one parameter, which is the new value of the property. For example, if property x is assigned by the statement x = 1 , the set function is passed the parameter 1 of type number. The return value of the set function is ignored. You can add getter/setter properties to prototype objects. If you add a getter/setter property to a prototype object, all object instances that inherit the prototype object inherit the getter/setter property. This makes it possible to add a getter/setter property in one location, the prototype object, and have it propagate to all instances of a class (similar to adding methods to prototype objects). If a get/set function is invoked for a getter/setter property in an inherited prototype object, the reference passed to the get/set function is the originally referenced object—not the prototype object. If invoked incorrectly, Object.addProperty() can fail with an error. The following table describes errors that can occur:
| |||||||||
|
|
|
|
|
Associates a movie clip symbol with an ActionScript object class If a symbol doesn’t exist, Flash creates an association between a string identifier and an object class. When an instance of the specified movie clip symbol is placed on the Timeline, it is registered to the class specified by thetheClass parameter rather than to the class MovieClip. When an instance of the specified movie clip symbol is created by using MovieClip.attachMovie or MovieClip.duplicateMovieClip, it is registered to the class specified by theClass rather than to the MovieClip class. If theClass is null, this method removes any ActionScript class definition associated with the specified movie clip symbol or class identifier. For movie clip symbols, any existing instances of the movie clip remain unchanged, but new instances of the symbol are associated with the default class MovieClip. If a symbol is already registered to a class, this method replaces it with the new registration. When a movie clip instance is placed by the Timeline or created using MovieClip.attachMovie or MovieClip.duplicateMovieClip, ActionScript invokes the constructor for the appropriate class with the keywordthis pointing to the object. The constructor function is invoked with no parameters. If you use this method to register a movie clip with an ActionScript class other than MovieClip, the movie clip symbol doesn’t inherit the methods, properties, and events of the built-in MovieClip class unless you include the MovieClip class in the prototype chain of the new class. The following code creates a new ActionScript class called theClass that inherits the properties of the MovieClip class: theClass.prototype = new MovieClip();
| ||||||
|
|
|
Converts the specified object to a string and returns it.
|
|
|
Removes a watchpoint created with Object.watch() This method returns a value of true if the watchpoint is successfully removed, false otherwise.
| |||
|
|
Returns the primitive value of the specified object If the object does not have a primitive value, the object is returned.
|
|
|
Registers an event handler to be invoked when a specified property of an ActionScript object changes. When the property changes, the event handler is invoked with myObject as the containing object. Your can use the return statement in your callback method definition to affect the value of the property you are watching. The value returned by your callback method is assigned to the watched object property. The value you choose to return depends on whether you wish to monitor, modify or prevent changes to the property:
If the A watchpoint can filter (or nullify) the value assignment, by returning a modified Only a single watchpoint can be registered on a property. Subsequent calls to The The Generally, predefined ActionScript properties, such as
| |||||||||
|