A real native Alert for Flex / Air

On May 3, 2009, Air,Components,Flex - 6 Comments

When you’re working on an Air project in Flex, and you want an alert to popup, you have a problem. Air doesn’t come with an ‘aired’ version of the Flex Alert. The flex Alert is fine, as long as you work with a single windowed application. As soon as you have more than one window, the Alert of Flex becomes more or less useless. Since you’ve got more than 1 window, Flex doesn’t know which window to make the parent window, so a model alert isn’t possible anymore.
I’ve taken the code from the mx.Alert and rewritten it to an AirAlert. It works exactly as the normal alert, only now it creates a window instead of a Panel / Titlewindow.

Usage: AirAlert.show(‘Test Alert!’, ‘Test Alert!’);
(The same as a normal alert :-P )

Notice: I didn’t copy the Alert.YES / Alert.NO stuff, so you have to use those from the Alert class.
Notice2: You’ll find no license or whatsoever, just use it as you like.

Download / View the source



What others have to say:

1

[...] AirAlert                        Ids Klijsma [...]

2

Wow!!

Thanks for this, but one help I need from you is that can you help to post the Flash CS3 Air version of this?

I will really appreciate this.

3

No, sorry, it’s based on the Flex Alert component, so it uses classes which are not available in flash.

4

Do you have a version of this that works in Flex 4? This version won’t compile with Flex 4.

Thanks,

Mark.

5

Not yet, but I don’t think I’ll come up with one that does very soon… (kinda busy at the moment :D )

What compile errors does FB give?

6

May be you will be interested in this project(developer of this project might be interested too):
http://code.google.com/p/as3nativealertlib/
To make superior alerts for AIR. :)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Submit comment