I can’t seem to access anything from a loaded swf file. I can, however access parent variables/methods from inside the loaded swf file.
var ldr:ProLoader;
function loadExternalSWF():void {
ldr = new ProLoader();
ldr.load(new URLRequest("introAS3.swf"));
wrapperMC.addChild(ldr);
}
loadExternalSWF();
buttonNextMC.addEventListener(MouseEvent.CLICK, buttonNextMC_Click);
function buttonNextMC_Click(event:MouseEvent):void {
MovieClip(wrapperMC).ldr.gotoAndPlay(31);
}
This just gives me the error:
TypeError: Error #1010: A term is undefined and has no properties.
EDIT: wrapperMC is just an empty movie clip instance that I’ve created and positioned on the stage to load the external movie into.
Why should
wrapperMChas a property with the name “ldr”? You could go with:On the other hand, it’s unlikely that your loaded clip replaces your ProLoader object instead it’s added it to it’s own child collection. In this case, you have to get the loaders child to call
gotoAndPlay().Without knowledge of of how ProLoader works I assume you have the following child structure
wrapperMC -> ldr -> introAS3
so you could go with:
But this is only a guess.