i've created a socket extension class. the pseudo code below tries to make a socket connection using the passed parameters. if there is an security error, such as the port number not being an acceptable port number, i want to handle the security error.
however, i can't catch the security error. a popup window appears with a description of the error and my errorHandler function is never called.
public class mySocket extends Socket
{
private var host:String;
private var port:int;
public function mySocket(host:String, port:int)
{
this.host = host;
this.port = port;
super();
init();
}
public init():void
{
addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
super.connect(host, port);
}
private function errorHandler(evt:SecurityErrorEvent):void
{
trace("Handle Error"); //doesn't get called when security error occurs
}
}