hasOwnProperty (Object.hasOwnProperty method)
public hasOwnProperty(name:String) : Boolean
Indicates whether an object has a specified property defined. This method returns
target object has a property that matches the string specified by the
otherwise. This method does not check the object's prototype chain and returns
false
only if the property exists on the object itself.
Availability: ActionScript 1.0; Flash Player 6
Parameters
-
name:String
Returns
- A Boolean value:
Boolean
parameter,
otherwise.
false
isPropertyEnumerable
(Object.isPropertyEnumerable method)
public isPropertyEnumerable(name:String) : Boolean
Indicates whether the specified property exists and is enumerable. If
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
Parameters
-
name:String
Returns
- A Boolean value:
Boolean
enumerable.
Example
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
996
ActionScript classes
if the target object has the property specified by the
true
if the property specified by the
true
property, is not enumerable.
true
parameter, and
name
, then the property
true
parameter is
name
if the
true
name
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?