The Input class

The Input class
The Input class
This class provides convenience functions for getting simple input from the user. The following code can be used to open a dialog that queries the user for a text:
var name = Input.getText( "What is your surname? " );
if (name) {
    processname(name);
}
  • getText( label : String, text : String, title : String ); Asks the user for a text. label specifies the descriptive label and text specifies the default text. The function returns the text entred by the user or undefined if the user canceled.

  • getNumber( label : String, value : Number, decimals : Number, minValue : Number, maxValue : Number, title : String ); Asks the user for a number. label specifies the descriptive label, value specifies the default value, decimals specifies the number of decimals allowed, minValue specifies the minimum value and maxValue specifies the maximum value. The function returns the value entered by the user or undefined if the user canceled.

  • getItem( label : String, itemList : Array, current : String, editable : Boolean, title : String ); Asks the user to select an item from a predefined list of values specified by itemList. The descriptive label is specified with label. current specifies the value that is selected when the dialog starts. If editable is true, the user is allowed to enter a value that is not in the itemList. The function returns the value selected or entered by the user or undefined if the user canceled.