Hi!
http://reghellin.com/debug/closeLoader/test1.html
I’m quite suck on a problem I didn’t expect: the 2 green buttons and the first blu one, all call a Loader.load() method to load 3 different really simple test swf (with a red car inside), but after loading the first one, all the buttons don’t work anymore. It seems that they don’t even get the onclick event (tried some trace test…). The seven more strange is that they in the flash swf preview, I can load 2 files, any 2, then the buttons don’t work anymore. So, in a browser, I can load 1 file, in the flash IDE, 2 files…
Here’s the code:
public function loadExtDisplay(file){
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onIOError, false, 0, true);
loader.load(new URLRequest(file));
dispatchEvent(new Event(FileLoader.LOAD_START));
busy = true;
return loader;
}
//AND LATER…
public function onLoadComplete(e:Event){
if(fileType == "image"){
currentLoadedFile = Bitmap(e.target.content);
} else if(fileType == "swf"){
var className:String = getQualifiedClassName(e.target.content);
var appDomain:ApplicationDomain = e.target.content.loaderInfo.applicationDomain;
var fileClass = appDomain.getDefinition(className);
currentLoadedFile = new fileClass();
}
if(destination){ destination.addChild(currentLoadedFile); }
removeAllEvents();
busy = false;
dispatchEvent(new Event(FileLoader.LOAD_COMPLETE));
}
//AND THE BUTTONS:
p3.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void { trace('click!'); loadFile(e, 'files/img/car.gif') }, false, 0, true);
p4.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void { trace('click!'); loadFile(e, 'files/img/car.png') }, false, 0, true);
p5.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void { trace('click!'); loadFile(e, 'files/img/car.jpg') }, false, 0, true);
LoadFile is another method that just calls loadExtDisplay(), nothing more…
ANY IDEA??