Hi!
I am writing a simple application which communicates with web services a lot.
So I am listening for success and fault events very often. When service returns a fault, I show an alert to a user saying something like: "Sorry there was a problem with a service, we will try to call it later"
But there is a problem. When user didn't notice an alert, and service is still dead before the second call the alert will be shown again, and again and again (so There will be very many alert objects which is bad)
I want to make alert a kind of singleton. So I am trying to produce a class something like
import mx.controls.Alert;
public class SingleAlert extends Alert
{
public static var count:Number = 0;
public function SingleAlert()
{
super();
}
override public static function show():void
{
if(count = 0){
super.show();
counter += counter;
}
}
}
Actually I have few problems. And can't finish the class...
I don't understand how to call show function (e.g. how to pass a string to it), also how to check the situation when user closes alert box. In this case I should show a new one.
Please help me to implement the class. Thanks