User Guide

Element object 149
Element object
Availability
Flash MX 2004.
Description
Everything that appears on the Stage is of the type Element. The following code example lets you
select an element:
fl.getDocumentDOM().getTimeline().frames[0].layers[0].elements[0];
Method summary for the Element object
The following methods are available for the Element object:
Property summary for the Element object
The following properties are available for the Element object:
Method Description
element.getPersistentData() Retrieves the value of the data specified by the name parameter.
element.hasPersistentData() Determines whether the specified data has been attached to the
specified element.
element.removePersistentData() Removes any persistent data with the specified name that has
been attached to the object.
element.setPersistentData() Stores data with an element.
Property Description
element.depth Read-only; an integer that has a value greater than 0 for the
depth of the object in the view.
element.elementType Read-only; a string that represents the type of the specified
element.
element.height A float value that specifies the height of the element in pixels.
element.left Read-only; a float value that represents the left side of the
element.
element.locked A Boolean value: true if the element is locked; false otherwise.
element.matrix A Matrix object. The matrix has properties a, b, c, d, tx, and
ty. a, b, c, d are floating point values; tx and ty are
coordinates.
element.name A string that specifies the name of the element, normally referred
to as the Instance name.
element.top Read-only; top side of the element.
element.width A float value that specifies the width of the element in pixels.
CHAPTER 3
Objects