A real native Alert for Flex / Air
On May 3, 2009, Air,Components,Flex - 7 CommentsWhen 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
)
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.