Instance object

 < Day Day Up > 

Inheritance Element object > Instance object

Availability

Flash MX 2004.

Description

Instance is a subclass of the Element object.

Property summary for the Instance object

In addition to all of the Element object properties, Instance has the following properties:

Property

Description

instance.instanceType

Read-only; a string that represents the type of Instance.

instance.libraryItem

Library item used to instantiate this instance.


instance.instanceType

Availability

Flash MX 2004; acceptable value of "video" added in Flash 8.

Usage

instance.instanceType

Description

Read-only property; a string that represents the type of Instance. Acceptable values are "symbol", "bitmap", "embedded video", "linked video", "video", and "compiled clip".

NOTE

In Flash MX 2004, the value of instance.instanceType for an item added to the library using library.addNewItem("video") is "embedded_video". In Flash 8, the value is "video". See library.addNewItem().


Example

The following example shows that the instance type of a movie clip is "symbol":

// Select a movie clip, and then run this script. var type = fl.getDocumentDOM().selection[0].instanceType; fl.trace("This instance type is " + type);

instance.libraryItem

Availability

Flash MX 2004.

Usage

instance.libraryItem

Description

Property; a library item used to instantiate this instance. You can change this property only to another library item of the same type (that is, you cannot set a symbol instance to refer to a bitmap). See library object.

Example

The following example changes the selected symbol to refer to the first item in the library:

fl.getDocumentDOM().selection[0].libraryItem =   fl.getDocumentDOM().library.items[0];

     < Day Day Up > 


    Developing Extensions for Macromedia Flash 8
    Developing Extensions for Macromedia Flash 8
    ISBN: 032139416X
    EAN: 2147483647
    Year: 2005
    Pages: 81

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net