where to catch a SecurityError?

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

sstark
Posts: 77
Joined: 21 Nov 2008, 16:06

where to catch a SecurityError?

Postby sstark » 22 Dec 2008, 23:36

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?
sstark
Posts: 77
Joined: 21 Nov 2008, 16:06

Postby sstark » 23 Dec 2008, 00:13

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.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 23 Dec 2008, 07:17

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
--
gotoAndPlay()
...addicted to flash games
sstark
Posts: 77
Joined: 21 Nov 2008, 16:06

Postby sstark » 23 Dec 2008, 17:57

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.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 23 Dec 2008, 20:49

I can't reproduce it. Can you drop us an email with simple client (SWF) example that fires that error?
I've tested with Flash Player 9 and 10-debug under MacOSX

Btw, happy Xmas! :)
Lapo

--

gotoAndPlay()

...addicted to flash games
sstark
Posts: 77
Joined: 21 Nov 2008, 16:06

Postby sstark » 23 Dec 2008, 22:02

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.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 Jan 2009, 09:27

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 :)
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 16 guests