Working with specific properties for selected elements

Some elements have specific properties that can be returned in addition to those that can be returned for any selected object (for more information, see Working with properties for any selected object). These specific properties are available for each of the following elements when the elements are selected.

Hotspot

To return the alt tag that has been applied to the currently selected Hotspot, type the following code:

altTag = fw.selection[0].altText;

SliceHotspot

SliceHotspot is a subclass of Hotspot. A slice has all Hotspot properties, plus the following properties:

To return the name of the currently selected slice, type the following code:

sliceName = fw.selection[0].baseName;

Path

Note: For the complete list of path attributes properties, see pathAttributes.

To return the value of the fill color for the currently selected path, type the following code:

fillColor = fw.selection[0].pathAttributes.fillColor

Group

To return the number of objects in a selected group, type the following code:

numOfObjectsinGroup = fw.selection[0].elements.length;

Instance

To return the instanceType for the currently selected instance, type the following code:

instance = fw.selection[0].instanceType;

Text

Note: For the complete list of pathAttributes properties, see pathAttributes.

To return the antiAliasMode setting for the currently selected text block, type the following code:

antiAliasedSetting = fw.selection[0].antiAliasMode;

RectanglePrimitive

Note: For the complete list of path attributes properties, see pathAttributes.

To return the roundness setting for the currently selected rectangle, type the following code:

roundness = fw.selection[0].roundness;

pathAttributes

Several objects have the pathAttributes property. The following list is the valid set of pathAttributes subproperties that can be returned or set:

To return the name of brush on the current path, type the following code:

brush = fw.selection[0].pathAttributes.brush.name;

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fireworks/8/fwextending/fw_02_71.htm