User Guide
202 Objects
Description
Read-only property; top side of the element. The value of element.top is relative to the
upper left of the Stage for elements that are in a scene, and is relative to the symbol’s
registration point if the element is stored within a symbol. Use
document.setSelectionBounds() or document.moveSelectionBy() to set this property.
Example
The following example shows how the value of this property changes when an element
is moved:
// Select an element on the Stage and then run this script.
var sel = fl.getDocumentDOM().selection[0];
fl.trace("Top (before) = " + sel.top);
fl.getDocumentDOM().moveSelectionBy({x:0, y:100});
fl.trace("Top (after) = " + sel.top);
See the element.elementType example.
element.width
Availability
Flash MX 2004.
Usage
element.width
Description
Property; a float value that specifies the width of the element in pixels.
Example
The following example sets the width of the specified element to 100:
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].width=
100;
NOTE
Do not use this property to resize a text field. Instead, select the text field and use
document.setTextRectangle(). Using this property with a text field scales the text.