# Prob withpreloader

**URL:** https://forum.kirupa.com/t/prob-withpreloader/163070
**Category:** Uncategorized
**Created:** [September 19, 2005, 3:20pm UTC](https://forum.kirupa.com/t/prob-withpreloader/163070 "2005-09-19T15:20:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![val\_B](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@val\_B](https://forum.kirupa.com/u/val_B)
#### Post date: [September 19, 2005, 3:20pm UTC](https://forum.kirupa.com/t/prob-withpreloader/163070/1 "2005-09-19T15:20:54Z")

</div>

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
