• Home
  • About Me
  • AIR Central
  • AS3 Libs
  • Books
  • Flex Central
  • Resources
  • The Guru's
  •  

    AIR AlertMXWindow Component (Toast Style)

    After requests from the release of AlertWindow which extended flash.display.NativeWindow yesterday, I am releasing AlertMXWindow which extend mx.core.Window allowing for the inclusion of any mx component.

    This version operates the same as the NativeWindow version rising from the lower right corner of the screen and pausing for the delay time set by the application or the default of 3 seconds. It also has the ability to bounce if delay time is set to 0 and notify is true.

    alertmxwin.jpg

    Grab the SWC file here.

    The sample below shows how to use AlertMXWindow creating it with ActionScript and adding a button. This example will have a title of “My Alert Title” and will have a delay time of 3 seconds.

    private function createAlertWithAS():void{
        var a:AlertMXWindow = new AlertMXWindow();
        a.title = "My Alert Title";
        var b:Button = new Button();
        b.label = "My Button";
        a.addChild(b);
        a.open();
    }

    The sample below shows how to use AlertMXWindow creating it with ActionScript and adding a button. This example will be 300 x 125, have a title of “My Alert Title” and will have a delay time of 5 seconds.

    private function createAlertWithAS():void{
        var a:AlertMXWindow = new AlertMXWindow();
        a.title = "My Alert Title";
        a.delayTime=5;
        a.width=300;
        a.height=125;
        var b:Button = new Button();
        b.label = "My Button";
        a.addChild(b);
        a.open();
    }

    The sample below shows how to use AlertMXWindow creating it with ActionScript and adding a button. This example will be 300 x 125, have a title of “My Alert Title” and will rise up and bounce until the user interacts with it.

    private function createAlertWithAS():void{
        var a:AlertMXWindow = new AlertMXWindow();
        a.title = "My Alert Title";
        a.delayTime=0;
        a.width=300;
        a.height=125;
        var b:Button = new Button();
        b.label = "My Button";
        a.addChild(b);
        a.open();
    }

    The sample below shows how to use AlertMXWindow creating it with ActionScript and adding a button. This example will be 300 x 125, have a title of “My Alert Title” and will rise up and remain static until the user closes it.

    private function createAlertWithAS():void{
        var a:AlertMXWindow = new AlertMXWindow();
        a.title = "My Alert Title";
        a.delayTime=0;
        a.width=300;
        a.height=125;
        a.notify=false;
        var b:Button = new Button();
        b.label = "My Button";
        a.addChild(b);
        a.open();
    }

    The code below shows how to subclass AlertMXWindow as an MXML object:

    <?xml version="1.0" encoding="utf-8"?>
    <AlertMXWindow xmlns="com.everythingflex.air.components.*"
        xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
         title="My Window" delayTime="5" width="300" height="100">
        <mx:Button label="Button" x="116.5" y="10"/>
        <mx:ColorPicker x="10" y="10"/>
        <mx:ComboBox x="69" y="40"/>
       
    </AlertMXWindow>

    Download the sample application here.

    9 Responses to “AIR AlertMXWindow Component (Toast Style)”

    1. Andy Matthews Says:

      This is awesome. I needed something JUST like this for an app I’m going to write. is it possible to specify that it stay open until the user explicitly closes it? Maybe by setting a negative timeout value?

    2. everythingflex Says:

      Yes, I just updated the code so that if you pass in a delay time of 0, it will remain until the user closes the window.

    3. chris Says:

      There is no swc file to be found. Can u please update it or give new dl site.
      Please email me a reply.
      Thanks!

    4. everythingflex Says:

      The SWC file download link is in the first paragraph here:
      http://blog.everythingflex.com/apollo/components-air/

    5. chris Says:

      Hi,
      Thanks for the quick reply!
      I did download that EverythingFlexAIR1.zip but I could not find the source or the SWC. There are bunch of images, swf, and some properites file.

    6. everythingflex Says:

      Right, there is no source included.

    7. chris Says:

      How about the SWC?

    8. everythingflex Says:

      The download link at http://blog.everythingflex.com/apollo/components-air/ is a SWC. Where did you get a zip file from?

    9. everythingflex Says:

      OK, I changed the download link at http://blog.everythingflex.com/apollo/components-air/ to a big red download image. Just click on that image for the SWC.

    Leave a Reply