Packagecom.hippohx
Classpublic class Dialog
InheritanceDialog Inheritance HaxeBackendListener Inheritance flash.events.EventDispatcher

The Dialog class allows you to display system messages, errors, open/save file dialogs or select folder dialog.



Protected Properties
 PropertyDefined by
 InheritedHAXE_BACKEND : String = ""
HAXE_BACKEND defines the ID that a Neko backend needs to use to call methods on this class (or the class extending this one).
HaxeBackendListener
Public Methods
 MethodDefined by
  
Do NOT call this constructor, please use getInstance method instead.
Dialog
  
confirm(title:String, msg:String, isError:Boolean = false):Boolean
Displays system's confirmation dialog to the user.
Dialog
 Inherited
Returns HAXE_BACKEND API identifier.
HaxeBackendListener
  
[static] Use this method to retrieve an instance of the class, do NOT call the constructor directly.
Dialog
  
message(title:String, msg:String, isError:Boolean = false):void
Displays system's dialog message to the user.
Dialog
  
openFile(title:String, msg:String, mask:DialogMask = null):Array
Opens system's select file dialog.
Dialog
  
saveFile(title:String, msg:String, initialDir:String = null):String
Opens system's save file dialog.
Dialog
  
selectFolder(title:String, msg:String):String
Opens system's select folder dialog.
Dialog
Constructor detail
Dialog()constructor
public function Dialog()

Do NOT call this constructor, please use getInstance method instead.

See also

Method detail
confirm()method
public function confirm(title:String, msg:String, isError:Boolean = false):Boolean

Displays system's confirmation dialog to the user.

Neko call is systools.Dialogs.confirm(title,msg,isError).

Parameters
title:String — Title shown on the dialog.
 
msg:String — Message shown on the dialog.
 
isError:Boolean (default = false) — Determines if the dialog is shown to the user as a regular message or as an error (usually comes with system's error sound). Default value is false.

Returns
Boolean — true if the user clicks on "Yes", false otherwise.
getInstance()method 
public static function getInstance():Dialog

Use this method to retrieve an instance of the class, do NOT call the constructor directly. Note that you don't need to store the instance to access its methods, you can simply do this:

Dialog.getInstance().message("Title","Message");

Returns
Dialog
message()method 
public function message(title:String, msg:String, isError:Boolean = false):void

Displays system's dialog message to the user.

Neko call is systools.Dialogs.message(title,msg,isError).

Parameters
title:String — Title shown on the dialog.
 
msg:String — Message shown on the dialog.
 
isError:Boolean (default = false) — Determines if the dialog is shown to the user as a regular message or as an error (usually comes with system's error sound). Default value is false.
openFile()method 
public function openFile(title:String, msg:String, mask:DialogMask = null):Array

Opens system's select file dialog. Use this dialog when you want to allow the user to select files that are alreday present on the system. Please note that this method only returns path to files, not the content of the files themselves.

Neko call is systools.Dialogs.openFile(title,msg,mask).

Parameters
title:String — Title shown on the dialog.
 
msg:String — Message shown on the dialog.
 
mask:DialogMask (default = null) — The mask filters what type of files are shown on the dialog. That means you can force the dialog to only show certain file types such as swfs, jpgs, xmls or any other. Default value is "all files" using AllFilesDialogMask class. You can use your own masks creating a new DialogMask object.

Returns
Array — An Array with full paths to the files selected by the user. Currently you cannot force a single-file selection dialog.

See also

saveFile()method 
public function saveFile(title:String, msg:String, initialDir:String = null):String

Opens system's save file dialog. Use this dialog when you want to allow the user to create a new file or select one that has been already created to overwrite it. Please note that this method only returns the path to the file, it doesn't actually save or overwrite it.

Neko call is systools.Dialogs.saveFile(title,msg,initialDir).

Parameters
title:String — Title shown on the dialog.
 
msg:String — Message shown on the dialog.
 
initialDir:String (default = null) — The folder in which the dialog is opened, default value is determined by System.getUserFolder(). You could for example start the dialog in your application's folder like this:

Dialog.getInstance().saveFile(title,msg,Application.getInstance().getApplicationFolder());

Returns
String — The path to the file selected by the user. null if the dialog is cancelled.

See also

selectFolder()method 
public function selectFolder(title:String, msg:String):String

Opens system's select folder dialog.

Neko call is systools.Dialogs.folder(title,msg).

Parameters
title:String — Title shown on the dialog.
 
msg:String — Message shown on the dialog.

Returns
String — The path to the folder selected by the user. null if the dialog is cancelled.