R – FLEX: Programmatically remove Alert

actionscript-3alertapache-flexdeep-linking

I need to programmatically remove an alert.

This is why:
My application uses BrowserManager to enable deep linking based off of the content in the #hash part of the url. If an alert is currently up, and the user hits the back button, the application will revert back to its previous state. But the Alert will still be up, and in many cases irrelevant at that point.

So is there a way to programmatically remove the Alert? so when the hash fragment changes I can remove it.

Thanks!

Best Answer

It turns out the Alert.show function returns an Alert reference and then just uses PopUpManager to add it to the display list. so if you capture the return reference when you call Alert.show you can tell PopUpManager to remove it. :)

Related Topic