Hasownproperty (Object.hasownproperty Method); Ispropertyenumerable (Object.ispropertyenumerable Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

If you use the
operator, you can also determine if an object belongs to a specified
instanceof
class:
var my_str:String = new String("sven");
trace(my_str instanceof String); //output: true
However, in the following example the
property converts primitive
Object.constructor
data types (such as the string literal seen here) into wrapper objects. The
operator
instanceof
does not perform any conversion, as seen in the following example:
var my_str:String = "sven";
trace(my_str.constructor == String); //output: true
trace(my_str instanceof String); //output: false
See also
instanceof operator

hasOwnProperty (Object.hasOwnProperty method)

public hasOwnProperty(name:String) : Boolean
Indicates whether an object has a specified property defined. This method returns
if the
true
target object has a property that matches the string specified by the
parameter, and
name
otherwise. This method does not check the object's prototype chain and returns
false
true
only if the property exists on the object itself.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
-
name:String
Returns
- A Boolean value:
if the target object has the property specified by the
Boolean
true
name
parameter,
otherwise.
false
isPropertyEnumerable
(Object.isPropertyEnumerable method)
public isPropertyEnumerable(name:String) : Boolean
Indicates whether the specified property exists and is enumerable. If
, then the property
true
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.
Object
555

Advertisement

Table of Contents
loading

Table of Contents