« AIR AlertWindow Component (Toast Style) | Main | Ribbit on the loose »
AIR AlertMXWindow Component (Toast Style)
| By Rich Tretola | December 18, 2007 | |
| 2,658 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.

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 2 3 4 5 6 7 8 | 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.
1 2 3 4 5 6 7 8 9 10 11 | 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.
1 2 3 4 5 6 7 8 9 10 11 | 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.
1 2 3 4 5 6 7 8 9 10 11 12 | 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:
1 2 3 4 5 6 7 8 9 | <?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.
Topics: Adobe AIR | 13 Comments »








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?
Reply to this comment
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.
Reply to this comment
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!
Reply to this comment
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.
Reply to this comment
January 24th, 2008 at 1:28 pm
Right, there is no source included.
Reply to this comment
January 24th, 2008 at 3:38 pm
How about the SWC?
Reply to this comment
November 27th, 2008 at 7:47 pm
Is there a way to hide the title bar?
The area that say “My Alert Title” with the maximize, minimize and close buttons?
Reply to this comment
April 2nd, 2009 at 11:05 am
Does this work at all??? I dont see any code that works? Help!!!
Reply to this comment
Rich Tretola Reply:
April 2nd, 2009 at 11:23 am
You also need the swc file, which you can download from:
http://blog.everythingflex.com/air-central/everythingflexair1swc/
Reply to this comment
April 6th, 2009 at 1:42 pm
What am I doing wrong? I cannot even get this to work!!!!
Reply to this comment
April 14th, 2009 at 6:09 am
It seems that adding a Label or UITextField does not work. Do you have any idea why?
Reply to this comment
Marcel Reply:
April 14th, 2009 at 6:47 am
Forget it. This is some weird bug in Flex. I use some defraga stuff, and every time I add a new swc, I need to restart Flexbuilder to have it compile correctly… don’t know why.
Reply to this comment
October 29th, 2009 at 1:43 am
Why I always get error when I’m use this component on the compleks/big project, any solution for this???
VerifyError: Error #1053: Illegal override of WindowedSystemManager in mx.managers.WindowedSystemManager.
Reply to this comment