beautypg.com

Chapter 14: element object, Element object, Summary table for the – Adobe Extending Flash Professional CS5 User Manual

Page 207: See the first example below

background image

185

Last updated 5/2/2011

Chapter 14: 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:

var el = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];

Method summary
The following methods are available for the Element object:

Property summary
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.getTransformationPoint()

Gets the value of the specified element’s transformation point.

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.

element.setTransformationPoint()

Sets the position of the element’s transformation point.

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.layer

Read-only; represents the

Layer object

on which the element is located.

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

, t

x

, and

ty

.

a

,

b

,

c

, and

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.rotation

An integer or float value between -180 and 180 that specifies the object’s clockwise
rotation, in degrees.

element.scaleX

A float value that specifies the x scale value of symbols, drawing objects, and primitive
rectangles and ovals.

element.scaleY

A float value that specifies the y scale value of symbols, drawing objects, and primitive
rectangles and ovals.

This manual is related to the following products: