Calendar

December 2007
M T W T F S S
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Tag Cloud

Categories

Archives

Highest Rated

Most Viewed

Recent Posts

Recent Comments


« AIR AlertWindow Component (Toast Style) | Main | Ribbit on the loose »

AIR AlertMXWindow Component (Toast Style)

By Rich Tretola | December 18, 2007Print This Post Print This Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
77 views

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.

  1. private function createAlertWithAS():void{
  2.     var a:AlertMXWindow = new AlertMXWindow();
  3.     a.title = "My Alert Title";
  4.     var b:Button = new Button();
  5.     b.label = "My Button";
  6.     a.addChild(b);
  7.     a.open();
  8. }

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.

  1. private function createAlertWithAS():void{
  2.     var a:AlertMXWindow = new AlertMXWindow();
  3.     a.title = "My Alert Title";
  4.     a.delayTime=5;
  5.     a.width=300;
  6.     a.height=125;
  7.     var b:Button = new Button();
  8.     b.label = "My Button";
  9.     a.addChild(b);
  10.     a.open();
  11. }

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.

  1. private function createAlertWithAS():void{
  2.     var a:AlertMXWindow = new AlertMXWindow();
  3.     a.title = "My Alert Title";
  4.     a.delayTime=0;
  5.     a.width=300;
  6.     a.height=125;
  7.     var b:Button = new Button();
  8.     b.label = "My Button";
  9.     a.addChild(b);
  10.     a.open();
  11. }

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.

  1. private function createAlertWithAS():void{
  2.     var a:AlertMXWindow = new AlertMXWindow();
  3.     a.title = "My Alert Title";
  4.     a.delayTime=0;
  5.     a.width=300;
  6.     a.height=125;
  7.     a.notify=false;
  8.     var b:Button = new Button();
  9.     b.label = "My Button";
  10.     a.addChild(b);
  11.     a.open();
  12. }

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

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

Download the sample application here.

Share/Save/Bookmark

Topics: Adobe AIR |

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

  1. Andy Matthews Says:
    December 18th, 2007 at 10:19 am

    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:
    December 18th, 2007 at 10:35 am

    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:
    January 23rd, 2008 at 4:34 pm

    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:
    January 23rd, 2008 at 5:18 pm

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

  5. chris Says:
    January 24th, 2008 at 12:56 pm

    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:
    January 24th, 2008 at 1:28 pm

    Right, there is no source included.

  7. chris Says:
    January 24th, 2008 at 3:38 pm

    How about the SWC?

  8. everythingflex Says:
    January 24th, 2008 at 4:02 pm

    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:
    January 24th, 2008 at 4:49 pm

    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.

Comments