Avoid Security Sandbox Violation

nocrossdomain.com

An excellent idea by Nathan de Vries.

One Response to “Avoid Security Sandbox Violation”

  1. Adam Cherochak Says:

    Hi Nathan,

    I’m having a bit of trouble getting a URL through Flash. I receive the following error: “Security Sandbox Violation” “…Untrusted local SWFs may not contact the Internet…” I’ve tried your solution: http://nocrossdomain.com/ but I still have the error. Can you help me?
    If so, please contact me at adam.cherochak@gmail.com

    Here is the code I’m using (thanks goes to http://www.gotoandlearn.com/):

    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onLoaded);

    lb.addEventListener(Event.CHANGE, itemChange);

    function itemChange(e:Event):void
    {
    ta.text = lb.selectedItem.data;
    }

    var xml:XML;

    function onLoaded(e:Event):void
    {
    //trace(e.target.data);
    xml = new XML(e.target.data);
    //trace(xml);
    var il0:XMLList = xml.symbol;
    lb.addItem({data:il0.text()[0], label:”First Solar, Inc”});
    var il1:XMLList = xml.last_trade;
    lb.addItem({data:il1.text()[0], label:”Last Trade”});
    var il2:XMLList = xml.change;
    lb.addItem({data:il2.text()[0], label:”Change”});
    var il3:XMLList = xml.open;
    lb.addItem({data:il3.text()[0], label:”Open”});

    var myGainLoss:String;
    if (il3 < il1)
    {
    myGainLoss = “GAIN”;
    }
    else
    {
    myGainLoss = “LOSS”;
    }
    var il4:String = “Gain or Loss”;
    lb.addItem({data:myGainLoss, label:il4});
    }

    loader.load(new URLRequest(“http://www.ecubicle.net/livestockquotes.asmx/LiveMarket?stockSymbol=fslr”));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.