Object.constructor - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Object.constructor

Availability
Flash Player 5
Usage
myObject.constructor
Description
Property; reference to the constructor function for a given object instance. The
property is automatically assigned to all objects when they are created using the constructor for
the Object class.
Example
The following example is a reference to the constructor function for the
var my_str:String = new String("sven");
trace(my_str.constructor == String); //output: true
If you use the
instanceof
class:
var my_str:String = new String("sven");
trace(my_str instanceof String); //output: true
However, in the following example the
types (such as the string literal seen here) into wrapper objects. The
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, you can also determine if an object belongs to a specified
Object.constructor
constructor
object.
myObject
property converts primitive data
operator does
instanceof
Object.constructor
665

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents