Adobe After Effects Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
  +
====
 
   
 
===Description===
 
===Description===

Latest revision as of 01:46, 17 March 2010


Description[]

Opens a dialog prompting the user for input. The user has the option to input information and either click OK or Cancel. Concel returns false as well as leaving the default information in the input box unchanged.

Syntax[]

prompt(param1, param2)


Parameters[]

  • param1 (optional) string used as the dialogs message.
  • param2 (optional) the default string which is used to auto-populate the input field.


Example[]

Prompt-ex01

prompt("what is your name?", "Bob");

RESULT: A dialog appears asking the user, "what is your name?" with the name "Bob" already in the input field.

prompt("What is your name?", "");

RESULT: A dialog appears asking the user, "what is your name?" no information is pregenerated in the input field.

var yourName = prompt("What is your name?", "");

RESULT: A dialog appears asking the user, "what is your name?" no information is pre-generated in the input field. If any text is entered, it is stored in the variable "yourName" Otherwise false is stored into "yourName"

Notes[]

Although the second param2 is not needed, you should include an empty string.