Home
HomeFlexible, Lightweight and Truly Skinnable Flash ComponentsPHPObject and other Flash ExtensionsForumsBlog JournalLinks
Buy Flash Components
  GhostWire Components - Flash Components for RIAs
redhand GhostWire DialogBox
This Flash component is a three-in-one component allowing you to create three types of dialog boxes - AlertBox, ConfirmBox, and PromptBox. These dialog boxes are invoked using the methods alert(), confirm() and prompt() respectively, similar to javascript syntax.

Example
The following is an example of the DialogBox component (filesize 15KB)






Features
Three-in-One
With one instance of the DialogBox on the stage, you can easily invoke AlertBox, ConfirmBox and PromptBox. AlertBox is used to display important messages to the application user, for example "Warning! Low resources!". ConfirmBox is used to ask for confirmation from the user, example "Do you wish to logout?". PromptBox is used to get input from the user, example "Please enter your name".

Easy Usage
To use the DialogBox component, all you need to do is drag-n-drop an instance on the stage. It doesn't matter where you place it because it would be hidden during runtime. To invoke the AlertBox, simply use the myDialog.alert(message) method. To invoke the ConfirmBox, use the myDialog.confirm(message) method. To invoke the PromptBox, use the myDialog.prompt(message, defaultreply) method.

onResponse Event
The component has an onResponse event, which is used to handle user interaction with the dialog box. In the case of the PromptBox, the value of the user's input would be passed as a parameter. Otherwise, 'false' will be returned if user clicked on Cancel button, or 'true' if 'OK'. In the case of AlertBox, it doesn't matter what the user click to dismiss the dialog box but the onResponse event is used to tell the application that it can proceed.

Disable Background
While the DialogBox is active, other movieclips are disabled. Exceptions to this would be movieclips loaded at levels above 15000 (where DialogBox and Window components are occupying) - valid exceptions include your custom cursors and tooltips. All assets behind the dialog box (the background) will be disabled until the dialog box is dismissed. From the component properties panel, you may configure the 'Disabled Background Color' and 'Disabled Background Opacity' properties.

Auto Focus
When the PromptBox is invoked, the focus automatically goes to the input field of the dialog box. The focus also goes back to the input field if the user click anywhere outside the dialog box, or when the user has finished dragging the dialog box around. If the user hit the ESCAPE key, it is equivalent to pressing the CANCEL button; if the user hit the ENTER key, it is equivalent to pressing the OK button.

Custom Response Buttons (ConfirmBox)
You can specify the number of buttons, and their labels, for the ConfirmBox, by passing in a second parameter to the confirm method. For example, myDialogBox.confirm("Save changes to Untitled-1?",["Yes","No","Cancel"])




The label of the button pressed will be passed as a parameter to the onResponse event handler.

Snap to Pixel
The component snaps to pixel when published, ensuring that it looks crisp and sharp when the movie plays. Usually to achieve this, you need to ensure that you place your movieclips at integer coordinates (no decimal place) during authoring time. This is not necessary with GhostWire components, which will automatically snap to pixel when published. For example, if the component was placed at x coordinate 20.2, when published it will be placed at x coordinate 20.0 instead. In addition, the component also resizes itself to integer widths and heights.

Truly Skinnable
Extended from the Window component, the DialogBox component reuses the visual assets, therefore the skins for the Window component apply to the DialogBox:






Note
For the best effects, we recommend that you set your application to a non-scaling mode by entering the following actionscript in the first frame of your application:
Stage.scaleMode = "noScale";
Stage.align = "TL";



Availability
This flash component is part of the GhostWire Components Set 4.


Documentation


Flash Components
Button :: CheckBox :: CollapsibleMenu :: CollapsiblePane :: ColorPicker :: ComboBox :: ContextMenu :: DialogBox :: InputField :: ListBox :: Loader :: Menu :: SlideMenu :: NumericBox :: Panel :: ProgressBar :: RadioButton :: ScrollBar :: ScrollPane :: SlidePane :: Slider :: TabView :: TextArea :: TreeView :: Window

See also
Documentation :: FAQs :: Testimonials
 
Contact UsSite Map
Copyright © 2003-2006 GhostWire Studios