Compiledclipinstance.actionscript, Compiledclipinstance.description – Adobe Extending Flash Professional CS4 User Manual
Page 66

44
EXTENDING FLASH CS4 PROFESSIONAL
CompiledClipInstance object
// 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
.
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";