0

I have an application that is running on portal VK com. I need to load images (.png) from their domain (which are players avatars basicly). What I get is SecurityError: Error #2123. It looks like in crossdomain.xml file on their domain there is no proper tag.

I've done following things:

  1. Set allowSecurityDomain to * in my swf
  2. I'm passing LoaderContext to Loader::load method defined like this:

    var context:LoaderContext = new LoaderContext();
    var context.checkPolicyFile = true;
    loader.load(new URLRequest(img), context);
    

This is working on other portals (facebook, mojmir, odnoklassiniki, etc..) but not this one.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92

1 Answers1

0

If you want to load images you can use the Image tag:

 <mx:Image source="http://...." autoload="true" />

You won't have to deal with cross domain policy.

In AScript you can use:

var img:Image = new Image();
img.autoLoad = true;
img.source = "http://someurl/img.png"
img.addEventListener(Event.COMPLETE, function(e:Event):void {
   //loaded
});
img.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void {
   //not loaded
});
Majid Laissi
  • 19,188
  • 19
  • 68
  • 105