Compiledclipinstance.actionscript, Compiledclipinstance.description – Adobe Extending Flash Professional CS5 User Manual

Page 65

Advertising
background image

43

EXTENDING FLASH PROFESSIONAL

CompiledClipInstance object

Last updated 5/2/2011

// Get the name of the object.

var theName = fl.getDocumentDOM().selection[0].accName;

// Set the name of the object.

fl.getDocumentDOM().selection[0].accName = 'Home Button';

compiledClipInstance.actionScript

Availability
Flash MX 2004.

Usage

compiledClipInstance.actionScript

Description
Property; a string that represents the ActionScript for this instance; equivalent to

symbolInstance.actionScript

.

Example
The following code assigns ActionScript to specified elements:

// Assign some ActionScript to a specified Button compiled clip instance.

fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0]

.actionScript = "on(click) {trace('button is clicked');}";

// Assign some ActionScript to the currently selected Button compiled clip instance.

fl.getDocumentDOM().selection[0].actionScript =

"on(click) {trace('button is clicked');}";

compiledClipInstance.description

Availability
Flash MX 2004.

Usage

compiledClipInstance.description

Description
Property; a string that is equivalent to the Description field in the Accessibility panel. The description is read by the
screen reader.

Example
The following example illustrates getting and setting the

description

property:

// Get the description of the current selection.

var theDescription = fl.getDocumentDOM().selection[0].description;

// Set the description of the current selection.

fl.getDocumentDOM().selection[0].description =

"This is compiled clip number 1";

Advertising
This manual is related to the following products: