Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-09-2011, 03:06 PM   #1
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default root relative path vs absolute path

Ok. This is a head scratcher. Why would a root relative path cause a Security Sandbox error.. but an absolute path to the exact same path work fine..

the setup is this..

swf is located on say .. http://sub.mydomain.com/static/flash/

the html is targeting the swf like so .. /static/flash/my.swf
the html is passing a flashvars like so .. apiPath=/blah/api/

and in the actionscript we have ..

ActionScript Code:
var _url = apiPath+"some/other/?stuff=forauthentication"; var _req = new URLRequest(_url); _reg.method = "POST"; _req.data = additionalDataToSend_obj; var _loader = new URLLoader(); _loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, catchIt); _loader.load(_req); function catchIt(evt:SecurityErrorEvent){    error_txt.text = evt; }

now the issue is when it uses a root relative path. to send the data. It causes a security sandbox error "Error:2048".. but no explanation included .. like it usually does.

BUT..

when you include the domain as part of the path, everything works as expected.
ActionScript Code:
var domain = flashVars.url.match(/(http|https).*?\.(com|net|org)/)[0]; // returns the exact subdomain that everything is hosted on. var _url = domain+apiPath+"some/other/?stuff=forauthentication";
There is no cross domain issue. But it almost appears like URLLoader is not retaining the proper domain when using a root relative path.

is this a known bug or are we just missing something.

The issue is resolved. I'm just trying to understand why there would be a 'generic sandbox error' if everything is on the same domain.
__________________
Always optimizing...
xxneon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:36 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.