Alerts
View Sample :: Return to index  
classes.Global.alert(strTitle:String, strMsg:String, strIconPath:String, strBtns:String):pseudo.BaseWindow
There is no actual class that corresponds to the Alert window. Anyway, you can create one using the following technique. Since the alerts are windows you should create a windows manager for these alerts and to define the visible area in which your alerts will appear. Then you can use classes. Global.alert() function of the classes. Global class that is shipped with this package.

Parameters strTitle String value that will be displayed on the alert window title
strMsg String value that will be displayed as the message
strIconPath String value indicating the path to the icon to load into this alert
strBtns String value indicating what buttons will be displayed in the alert window
Returns The reference to the instance of the alert window.
Example
    //Get an instance of the look to be used in our example
    var look:Object = pseudo.look.XPLook.getInstance();
    
    //Create movie clip using pseudo.BaseMovie.create() method this movie clip will be
    // used as the area in which all our components will be drawn
    _global.main = pseudo.BaseMovie.create(_root, "main", 1);
    // set look and feel for the movie and everything that will be drawn on it
    _global.main.setLook(look);
    
    //Create alert windows manger
    var mng = _global.main.addItem(pseudo.WindowManager, "alertMng", 2);
    
    mng.setWorkArea(0, 0, Stage.width, Stage.height);
    
    //this code line will make our alerts appear in the center of the working area
    mng.setStart("center", "middle");
    
    //Create the button. Pressing this button will display the alert
    var btn = _global.main.addItem(pseudo.PushButton, "btn", 1);
    btn.setSize(90, 20);
    // add label
    var lbl = btn.addItem(pseudo.Label);
    lbl.setAlign("center");
    lbl.setText("Show Alert");
    
    // add listener
    btn.addListener("mouseRelease", this, onRelease);
    
    //Draw everything in our working movie clip
    _global.main.update();
    _global.main.draw();
    
    //Function that displays the alert
    function onRelease():Void
    {
      classes.Global.alert("test", "test", "iconError", "ok,OK");
    }
           
Flash UI Components (c)TUFaT.com, All Rights Reserved.