Z.Prompt

Studio

Z.Prompt

Inherits from Z.Base

Description

The Z.Prompt object requests a text value from the user.

For more information about accepting keyboard entry from a user see Getting Keyboard Input.

Example

var myprompt = Z.Prompt({
  title: "Hello",
  text: "Please enter your name:",
  defaultValue: "Dog",
  maxLength: 12,
  filterProfanity: true
});

myprompt.on("confirm", function(theirName) {
  console.log("They entered: " + theirName);
});

myprompt.on("cancel", function() {
  console.log("They cancelled the dialog :-(");
});

myprompt.show();

Provided by Z.Prompt

Constructor

Z.Prompt(...) Constructs a new Z.Prompt object.

Events

cancel Emitted if the user cancels the dialog.
confirm Emitted if the user completes the dialog.
done Emitted when the user returns from the dialog.

Functions

defaultValue( ) Gets the default value that will be in the text entry dialog when it is shown.
defaultValue(...) Sets the default value that will be in the text entry dialog when it is shown.
filterProfanity( ) Get if the user's text will be filtered for bad language.
filterProfanity(...) Set if the user's text will be filtered for bad language.
maxLength( ) Gets the maximum number of characters that the user will be permitted to enter.
maxLength(...) Sets the maximum number of characters that the user will be permitted to enter.
show( ) Display the text entry dialog to the user.
text( ) Gets the instructional text that will be displayed to the user in the text entry dialog.
text(...) Sets the instructional text that will be displayed to the user in the text entry dialog.
title( ) Gets the text to display as the title of the text entry dialog.
title(...) Sets the text to display as the title of the text entry dialog.

Interfaces

Parameters A dictionary of parameters.

Inherited from Z.Base

Functions

emit(...) Calls the handler functions attached to an event.
hasTag(...) Returns true if this object has the specified tag.
off(...) Removes a handler function from an event.
on(...) Attaches a handler function to an event.
one(...) Attaches a single-use handler function to an event.
pushTag(...) Adds a tag to this object.
removeTag(...) Removes a tag from this object.
tags( ) Gets an array of the tags that this object belongs to.
tags(...) Sets the array of the tags that this object belongs to.
Open in new window