PDA

View Full Version : Loading external images won't work within a class



Manic Ant
August 27th, 2009, 06:48 AM
Hi, I'm trying to load external images in the usual way;


loader=new Loader();
loader.load(new URLRequest(_thumb));
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE,onLoadComplete);

private function onLoadComplete(e:Event):void{
thumb.addChild(loader);
}But when it comes through to the onLoadComplete Function, I get a sandbox violation. I've tried using Security.allowDomain and a crossdomain.xml file, but it just won't work. Even more annoyingly, if I do the exact same thing, but within the main class file, it works fine.

5 or so of these classes that need to load images are loaded from an XML file (which also works fine without allowdomain etc). Is there some sort of conflict going on because of there being more than one of them?

Thanks in Advance.

Martin

Manic Ant
August 27th, 2009, 08:27 AM
Please ignore this, it turned out I'd forgotten to actually initiate the "thumb" object.

D'OH