Working with selected objects
73
To test whether a text block is selected, type the following code:
firstSelection = fw.selection[0];
if (firstSelection == "[object Text]"){
alert("I am a text block");
}
You can use the information in the following sections to return or set property values.
Note:
The return value for a property may be
null
.
Working with properties for any selected object
You can return and set the following properties of any type of selected object:
•
top
•
left
•
width
•
height
•
visible
•
opacity
•
blendMode
•
name
•
mask
To return the name of the selected object, type the following code:
objectName=fw.selection[0].name;
The following properties contain other properties that you can return or set:
elementMask
•
element
•
linked
•
enabled
•
mode
•
showAttrs
•
autoExpandImages
effectList
•
name
•
effects
To return the name of the first effect that is applied to the selected object, type the following code:
effectName=fw.selection[0].effectList.effects[0].name;
Summary of Contents for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER
Page 1: ...Extending Fireworks...
Page 4: ...4 Contents...
Page 8: ...8 Chapter 1 Extending Fireworks Overview...
Page 102: ...102 Chapter 4 Auto Shapes...