Hello,
I need to catch a SecurityError in a try / catch for when it tries to connect to blueBox and fails because the server is not running. Instead of the Flash Player displaying an error in this case, I need to redirect to a URL and post a variable. The redirect code is done, just don't know where exactly in the API to catch this error.
Any help?
where to catch a SecurityError?
answered my own question.
in HttpConnection:
add in imports:
import flash.events.SecurityErrorEvent
import mx.core.Application
in 'send' method:
urlLoader.data = vars
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ioErrorHandler); // this is w hat's new
urlLoader.load(urlRequest)
then add this method:
private function ioErrorHandler(e:SecurityErrorEvent):void
{
mx.core.Application.application.displayErrorWindow(e.toString())
}
then in my main application I have a displayErrorWindow function that handles all errors.
in HttpConnection:
add in imports:
import flash.events.SecurityErrorEvent
import mx.core.Application
in 'send' method:
urlLoader.data = vars
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ioErrorHandler); // this is w hat's new
urlLoader.load(urlRequest)
then add this method:
private function ioErrorHandler(e:SecurityErrorEvent):void
{
mx.core.Application.application.displayErrorWindow(e.toString())
}
then in my main application I have a displayErrorWindow function that handles all errors.
Instead of the Flash Player displaying an error in this case, I need to redirect to a URL and post a variable.
I am not following.
Does the Flash Player fires an error if the BlueBox is not found?
I don't get this behavior. I get my normal onConnection event which reports a failure in connecting.
Are you using the latest API? Version 1.5.6 ?
Thanks
Lapo wrote:Instead of the Flash Player displaying an error in this case, I need to redirect to a URL and post a variable.
I am not following.
Does the Flash Player fires an error if the BlueBox is not found?
I don't get this behavior. I get my normal onConnection event which reports a failure in connecting.
Are you using the latest API? Version 1.5.6 ?
Thanks
yes, 1.5.6 is the API.
The problem arises when I try and connect when the server (sfs) has not been started. The onConnection handler does not catch this.
I would normally love to send this to you, however this is a work production and everything is under NDA. Plus we're VERY deep into this project now, and creating a 'dummy' version would actually be a fair amount of work... Not to mention I got it to work I can see why you want to track this problem down, however.
more information on the error. It's a SandBox error. The class is trying to open a socket to send the cross-domain policy (I believe), and since the server is not on it fails. This is before the initial connection.
Server specs:
Fedora (not sure if it's a core or not, or the version)
SFS
OpenSpace
Ruby on Rails using Mongrel
MySQL
And yes, a very merry Christmas to you as well! I hope you get whatever it is you've asked for, you deserve it and more!
p.s. - I just realized that I might of tested with SFS and RoR off, not just SFS off... this is because we can also test this project offline in the local projector.
more information on the error. It's a SandBox error. The class is trying to open a socket to send the cross-domain policy (I believe), and since the server is not on it fails. This is before the initial connection.
Server specs:
Fedora (not sure if it's a core or not, or the version)
SFS
OpenSpace
Ruby on Rails using Mongrel
MySQL
And yes, a very merry Christmas to you as well! I hope you get whatever it is you've asked for, you deserve it and more!
p.s. - I just realized that I might of tested with SFS and RoR off, not just SFS off... this is because we can also test this project offline in the local projector.
I see.
If the problem persist you can contact us directly. We have no problem signing an NDA. Then you can send us a link to the application so that we can see the problem in action.
As I said in my previous post we're not able to reproduce the problem by simply switching off the server
Happy new year
If the problem persist you can contact us directly. We have no problem signing an NDA. Then you can send us a link to the application so that we can see the problem in action.
As I said in my previous post we're not able to reproduce the problem by simply switching off the server
Happy new year
Who is online
Users browsing this forum: No registered users and 8 guests