Prob withpreloader

Hello,

I read the thread that Giansolo started with his preloader prob.Actually I have preloader prob ,but the solution given to him didn’t work for me as my set up of both MovieClip Loader() and preloader is different.

My prob is that I am loading my preloder from an external swf into my dynamically created movieClip on the master.swf .When I am running my trace command (target_mc.preloader_mc.bar_mc) I am getting undefined.

my code is as follows:

function createClip(target_mc:MovieClip, movie:String, depth:Number) {

//container_mc holds a reference to the created container_mc+depth

var container:MovieClip = target_mc.createEmptyMovieClip(“container_mc”+depth, depth);
loadImage(container, movie);
}

function loadImage(target_mc:MovieClip, movie:String) {
var masterMCL:MovieClipLoader = new MovieClipLoader();
var masterListener:Object = new Object();
masterListener.onLoadStart = function(target_mc) {
trace(target_mc.preloader_mc.bar_mc);
target_mc.preloader_mc.bar_mc._visible = true;
target_mc.preloader_mc.bar_mc._xscale = 0;

};

masterListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
//trace(target_mc.bar);
target_mc.preloader_mc.bar_mc._xscale = (loadedBytes/totalBytes)*100;
target_mc.preloader_mc.myTextFeild.text = “%”+Math.round((bytesLoaded/bytesTotal)*100);
};

masterListener.onLoadComplete = function(target_mc) {
target_mc.preloader_mc._visible = false;
target_mc.myTextFeild.text = “”;
target_mc._visible = true;
};

masterListener.onLoadError = function(target_mc, errorCode:String) {
target_mc.preloader_mc._visible = false;
target_mc.preloader_mc.myTextFeild.text = “”;

};
masterMCL.addListener(masterListener);
masterMCL.loadClip(movie, target_mc);
}
createClip(this, “preloader.swf”, 5);
createClip(this, “mainMenu.swf”, 20);

thnks in advance