I’m using the following preloader code (from the Kirupa tutorial):
http://www.kirupa.com/developer/flashcs3/loading_image_as3_pg3.htm
var imageLoader:Loader;
function loadImage([url:String):void](http://www.kirupa.com/forum/String):void) {
// Show Preloader
preloader.visible = true;
// Set properties on my Loader object
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
loadImage("header_image_01.jpg");
function imageLoaded(e:Event):void {
// Load Image
imageLoadArea.addChild(imageLoader);
gotoAndStop(2);
// Hide Preloader
preloader.visible = false;
}
function imageLoading(e:ProgressEvent):void {
stop();
// Get current download progress
var loaded:Number = e.bytesLoaded / e.bytesTotal;
// Send progress info to "preloader" movie clip
preloader.SetProgress(loaded);
}
In this line of code:
imageLoadArea.addChild(imageLoader);
“imageLoadArea” is a blank movie clip on the stage. How would I append this loaded image on a movie clip that’s inside a movie clip? The simple solutions of “mc_name.imageLoadArea” doesn’t work without throwing an “invalid reference” error. I’m figuring there is something blantant I am missing.
Any suggestions would be appreciated.
Thanks.