beautypg.com

Prompt() – Adobe Extending Flash Professional CS5 User Manual

Page 44

background image

22

EXTENDING FLASH PROFESSIONAL

Top-Level Functions and Methods

Last updated 5/2/2011

Parameters
None.

Returns
Nothing.

Description
Function; called when the extensible tool is active and the user changes its options in the Property inspector. You can
use the

tools.activeTool

property to query the current values of the options (see

tools.activeTool

).

Example
The following example displays a message in the Output panel when the extensible tool is active and the user changes
its options in the Property inspector.

function notifySettingsChanged() {

var theTool = fl.tools.activeTool;

var newValue = theTool.myProp;

}

prompt()

Availability
Flash MX 2004.

Usage

prompt(promptMsg [,text])

Parameters

promptMsg

A string to display in the Prompt dialog box (limited to 256 characters in Mac

OS X).

text

An optional string to display as a default value for the text field.

Returns
The string the user typed if the user clicks OK;

null

if the user clicks Cancel.

Description
Method; displays a prompt and optional text in a modal Alert dialog box, along with OK and Cancel buttons.

Example
The following example prompts the user to enter a user name. If the user types a name and clicks OK, the name appears
in the Output panel.

var userName = prompt("Enter user name", "Type user name here");

fl.trace(userName);

See also

alert()

,

confirm()

This manual is related to the following products: