Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Object > isPropertyEnumerable (Object.isPropertyEnumerable method) | |||
public isPropertyEnumerable(name:String) : Boolean
Indicates whether the specified property exists and is enumerable. If true, then the property exists and can be enumerated in a for..in loop. The property must exist on the target object because this method does not check the target object's prototype chain.
Properties that you create are enumerable, but built-in properties are generally not enumerable.
Availability: ActionScript 1.0; Flash Player 6
name:String -
Boolean - A Boolean value: true if the property specified by the name parameter is enumerable.
The following example creates a generic object, adds a property to the object, then checks whether the object is enumerable. By way of contrast, the example also shows that a built-in property, the Array.length property, is not enumerable.
var myObj:Object = new Object();
myObj.prop1 = "hello";
trace(myObj.isPropertyEnumerable("prop1")); // Output: true
var myArray = new Array();
trace(myArray.isPropertyEnumerable("length")); // Output: false
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00002582.html