beautypg.com

Toolobj.setoptionsfile() – Adobe Extending Flash Professional CS4 User Manual

Page 517

background image

495

EXTENDING FLASH CS4 PROFESSIONAL

ToolObj object

Description
Method; sets the string that appears in the pop-up menu as the name for the tool. This method is used only when you
create extensible tools.

Example
The following example specifies that the tool named

theTool

should display the name “PolyStar Tool” in its pop-up

menu. This code is taken from the sample PolyStar.jsfl file (see

Sample PolyStar tool

” on page 14):

theTool = fl.tools.activeTool;

theTool.setMenuString("PolyStar Tool");

toolObj.setOptionsFile()

Availability
Flash MX 2004.

Usage

toolObj.setOptionsFile(xmlFile)

Parameters

xmlFile

A string that specifies the name of the XML file that has the description of the tool’s options. The XML file

must be placed in the same folder as the JSFL file.

Returns
Nothing.

Description
Method; associates an XML file with the tool. The file specifies the options to appear in a modal panel that is invoked
by an Options button in the Property inspector. You would usually use this method in the

configureTool()

function

inside your JSFL file. See

configureTool()

.

For example, the PolyStar.xml file specifies three options associated with the Polygon tool: