I don't know if I'm doing something wrong, but I can't get access to the content from loaded SWF. This should be obvious task. I'm using onInit event so everything should be fine.
Here is my simple code:
package {
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.loading.*;
import com.greensock.plugins.*;
import fl.events.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import nl.demonsters.debugger.MonsterDebugger;
public class Main extends MovieClip {
public var _loader:LoaderMax;
public var _swfLoader:SWFLoader;
private var debugger:MonsterDebugger;
public function Main() {
debugger = new MonsterDebugger(this);
_init();
}
private function _init():void {
_loader = new LoaderMax();
_swfLoader = new SWFLoader("contentSWF.swf", {name:"mc_content", container:this, x:0, y:0, onInit:_onInitHandler});
_loader.append(_swfLoader);
_loader.load(true);
}
private function _onInitHandler(event:Event) {
trace(event.target.content.testRect);
}
}
}
contentSWF.swf contains only one element on the stage - rectangle named testRect. I think that I should have access to it through content property, but I have an error:
ReferenceError: Error #1069: Property testRect not found on flash.display.Sprite and there is no default value.
at Main/_onInitHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::CommonLoader/_initHandler()
at com.greensock.loading::SWFLoader/_initHandler()
I've got some weird listing in MonsterDebugger too. Sometimes it shows that there is nothing inside mc_content (sprite):
and sometimes that it contains my testRect but inside another instance MovieClip:
Am I doing something wrong? Or it's a bug?
I'm using 2010-06-01 (version 0.81) of LoaderMax.
All my test files in the attachment.