I'm trying to load a local SWF then catch a few events that are fired but I can't see why this isn't working.
Here's the code
Parent.swf
_mcl = new MovieClipLoader();
_mcl.addListener(this);
_mcl.loadClip("Child.swf", rotator_mc);
function onLoadComplete(clip) {
clip.addEventListener("initAsLoaded", function() {trace("childLoaded loaded 1")});
}
function onLoadInit(clip) {
clip.addEventListener("initAsLoaded", function() {trace("childLoaded loaded 2")});
}
Child.swf
import mx.events.EventDispatcher;
function dispatchEvent() {};
function addEventListener() {};
function removeEventListener() {};
EventDispatcher.initialize(this);
trace("Child dispatching: childLoaded");
dispatchEvent({type:"childLoaded", target: this});
Now I was hoping that this would work, and the Parent would have "childLoaded caught 2" in the trace, but it doesn't.
Is there any way to achieve what I'm trying to do?