I found an issue in my AS3 application. On my local machine everything is good, but when I sent it to my friend, he wasn't able to open it on his computer, because he got
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: cannot load data from data.json
The same error happens when I upload my application to web. I can't play it and get the same error.
Here is my code:
var myTextLoader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("data.json");
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
myTextLoader.load(request);
...
private function onLoaded(e:Event):void
{
var loader:URLLoader = URLLoader(e.target);
var myObject:Object = JSON.parse(loader.data);
}
How can I fix it? Please, help me if you can :)