hi i am loading an external swf and need to access the assets within it heres my basic code:
i can access fine through the onComplete function of the loader but cannot access from anywhere else…
stop();
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
var mc:MovieClip = new MovieClip();
var mLoader:Loader = new Loader();
var mRequest:URLRequest=new URLRequest("external.swf");
addChild(mLoader);
function startLoad() {
mLoader.load(mRequest);
mLoader.contentLoaderInfo.addEventListener(Event.INIT, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
}
function onCompleteHandler(loadEvent:Event) {
mc = MovieClip(mLoader.content);
//THIS WORKS FINE
mc.main_txt.text = "adsa";
}
function onProgressHandler(mProgress:ProgressEvent) {
var percent:Number=mProgress.bytesLoaded/mProgress.bytesTotal;
trace(percent);
}
startLoad();
//THIS GIVES ERROR #1010: A term is undefined and has no properties.
mc.main_txt.text = "adsa";