SymbolItem object

 < Day Day Up > 

Inheritance Item object > SymbolItem object

Availability

Flash MX 2004.

Description

The SymbolItem object is a subclass of the Item object.

Method summary for the SymbolItem object

In addition to the Item object methods, you can use the following methods with the SymbolItem object:

Method

Description

symbolItem.convertToCompiledClip()

Converts a symbol item in the library to a compiled movie clip.

symbolItem.exportSWC()

Exports the symbol item to a SWC file.

symbolItem.exportSWF()

Exports the symbol item to a SWF file.


Property summary for the SymbolItem object

In addition to the Item object properties, the following properties are available for the SymbolItem object:

Property

Description

symbolItem.scalingGrid

A Boolean value that specifies whether 9-slice scaling is enabled for the item.

symbolItem.scalingGridRect

A Boolean value that specifies whether 9-slice scaling is enabled for the item.

symbolItem.sourceAutoUpdate

A Boolean value that specifies whether the item is updated when the FLA file is published.

symbolItem.sourceFilePath

A string that specifies the path for the source FLA file as a file:/// URI.

symbolItem.sourceLibraryName

A string that specifies the name of the item in the source file library.

symbolItem.symbolType

A string that specifies the type of symbol.

symbolItem.timeline

Read-only; a Timeline object.


symbolItem.convertToCompiledClip()

Availability

Flash MX 2004.

Usage

symbolItem.convertToCompiledClip()

Parameters

None.

Returns

Nothing.

Description

Method; converts a symbol item in the library to a compiled movie clip.

Example

The following example converts an item in the library to a compiled movie clip:

fl.getDocumentDOM().library.items[3].convertToCompiledClip();

symbolItem.exportSWC()

Availability

Flash MX 2004.

Usage

symbolItem.exportSWC( outputURI )

Parameters

outputURI A string, expressed as a file:/// URI, that specifies the SWC file to which the method will export the symbol. The outputURI must reference a local file. Flash does not create a folder if outputURI does not exist.

Returns

Nothing.

Description

Method; exports the symbol item to a SWC file.

Example

The following example exports an item in the library to the SWC file named my.swc in the tests folder:

fl.getDocumentDOM().library.items[0].exportSWC("file:///c|/tests/my.swc");

symbolItem.exportSWF()

Availability

Flash MX 2004.

Usage

symbolItem.exportSWF( outputURI )

Parameters

outputURI A string, expressed as a file:/// URI, that specifies the SWF file to which the method will export the symbol. The outputURI must reference a local file. Flash does not create a folder if outputURI doesn't exist.

Returns

Nothing.

Description

Method; exports the symbol item to a SWF file.

Example

The following example exports an item in the library to the my.swf file in the tests folder:

fl.getDocumentDOM().library.items[0].exportSWF("file:///c|/tests/my.swf");

symbolItem.scalingGrid

Availability

Flash 8.

Usage

symbolItem.scalingGrid

Description

Property; a Boolean value that specifies whether 9-slice scaling is enabled for the item.

Example

The following example enables 9-slice scaling for an item in the library:

fl.getDocumentDOM().library.items[0].scalingGrid = true;

See also

symbolItem.scalingGridRect

symbolItem.scalingGridRect

Availability

Flash 8.

Usage

symbolItem.scalingGridRect

Description

Property; a rectangle object that specifies the locations of the four 9-slice guides. For information on the format of the rectangle, see document.addNewRectangle().

Example

The following example specifies the locations of the 9-slice guides:

fl.getDocumentDOM().library.items[0].scalingGridRect = {left:338, top:237,   right:3859, bottom:713};

See also

symbolItem.scalingGrid

symbolItem.sourceAutoUpdate

Availability

Flash MX 2004.

Usage

symbolItem.sourceAutoUpdate

Description

Property; a Boolean value that specifies whether the item is updated when the FLA file is published. The default value is false. Used for shared library symbols.

Example

The following example sets the sourceAutoUpdate property for a library item:

fl.getDocumentDOM().library.items[0].sourceAutoUpdate = true;

symbolItem.sourceFilePath

Availability

Flash MX 2004.

Usage

symbolItem.sourceFilePath

Description

Property; a string that specifies the path for the source FLA file as a file:/// URI. The path must be an absolute path, not a relative path. This property is used for shared library symbols.

Example

The following example shows the value of the sourceFilePath property in the Output panel:

fl.trace(fl.getDocumentDOM().library.items[0].sourceFilePath);

symbolItem.sourceLibraryName

Availability

Flash MX 2004.

Usage

symbolItem.sourceLibraryName

Description

Property; a string that specifies the name of the item in the source file library. It is used for shared library symbols.

Example

The following example shows the value of the sourceLibraryName property in the Output panel:

fl.trace(fl.getDocumentDOM().library.items[0].sourceLibraryName);

symbolItem.symbolType

Availability

Flash MX 2004.

Usage

symbolItem.symbolType

Description

Property; a string that specifies the type of symbol. Acceptable values are "movie clip", "button", and "graphic".

Example

The following example shows the current value of the symbolType property, changes it to "button", and shows it again:

alert(fl.getDocumentDOM().library.items[0].symbolType); fl.getDocumentDOM().library.items[0].symbolType = "button"; alert(fl.getDocumentDOM().library.items[0].symbolType);

symbolItem.timeline

Availability

Flash MX 2004.

Usage

symbolItem.timeline

Description

Read-only property; a Timeline object.

Example

The following example obtains and shows the number of layers that the selected movie clip in the library contains:

var tl = fl.getDocumentDOM().library.getSelectedItems()[0].timeline; alert(tl.layerCount);

     < 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