Working with selected objects
93
Working with selected objects
When an object is selected, either programmatically (for example, using the
dom.selectAll()
function) or by a user, you can return (get) or set the value of that object’s
properties using common notation that will work on various objects. In other words, you can
write a command that will get or set the value of an object’s properties whether the user selects
a Text object, or an Image object, or any other recognized object. In Fireworks, a recognizable
object is classified as one of the following element types:
■
Hotspot
■
SliceHotspot
(basically, a slice)
■
Path
■
Group
■
Instance
■
Text
■
RectanglePrimitive
■
PathAttrs
■
Image
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");
}
doSkipUndefined
Boolean
Set to
true
if Export Undefined Slices is not
selected in Document Properties.
imagesDirPath
string
Relative URL to the images folder. For
example
, "images/"
, or
"../site_images"
,
or
""
(an empty string) if the images and the
HTML are in the same directory.
numColumns
integer
Number of columns in the HTML table.
Does not include shim column.
numRows
integer
Number of rows in the HTML table. Does
not include shim row.
shimPath
string
Relative URL to the shim GIF file; for
example,
"images/shim.gif"
.
Property (read-only)
Data type
Notes
Summary of Contents for FIREWORKS 8-EXTENDING FIREWORKS
Page 1: ...Extending Fireworks ...
Page 4: ...4 Contents ...
Page 358: ...358 Fireworks JavaScript API ...
Page 372: ...372 Index ...