# movieClipLoader function questions

**URL:** https://forum.kirupa.com/t/moviecliploader-function-questions/157923
**Category:** flash
**Created:** [August 5, 2005, 5:00am UTC](https://forum.kirupa.com/t/moviecliploader-function-questions/157923 "2005-08-05T05:00:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Thinker2501](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thinker2501](https://forum.kirupa.com/u/Thinker2501)
#### Post date: [August 5, 2005, 5:00am UTC](https://forum.kirupa.com/t/moviecliploader-function-questions/157923/1 "2005-08-05T05:00:34Z")

</div>

I am working with the movieClipLoader function to create a photo gallery site. I;ve been try to modify the Reusable loader tutorial and this is what i have:

/\* Set Content Dimensions \*/  
contentW = 100;  
contentH = 100;

/\* Image Data Array \*/  
imageDat = new Array();  
imageDat = [“2\_1\_1.jpg”];

/\* Create emptyClip to hold pic \*/  
var empty = this.createEmptyMovieClip(“picHolder”, 100);  
picHolder.\_visible = false;

/\* create loader and listener \*/

picLoader = new MovieClipLoader();  
loadStatus = new Object();  
picLoader.addListener(loadStatus);

/\* Declare Listener Function \*/  
loadStatus.onLoadInit = function(target\_mc) {  
\_root.loadBar.\_visible = 1;  
\_root.loadBar.\_xscale = 0;  
};  
loadStatus.onLoadProgress = function(target\_mc, tBytes, lBytes) {  
\_root.loadBar.\_xscale = (lBytes/tBytes)\*100;  
};  
loadStatus.onLoadComplete = function(target\_mc) {  
\_root.loadBar.\_visible = 0;  
\_root.contentW = \_root.picHolder.\_width;  
\_root.contentH = \_root.picHolder.\_height;  
\_root.scaleTween (\_root.contentW, \_root.contentH);  
}

/\* Tween \*/  
scaleTween = function (contentW, contentH) {  
\_global.tweening = 1;  
easeType = mx.transitions.easing.Strong.easeOut;  
var beginX = \_root.box.\_width;  
var beginY = \_root.box.\_height;  
var time = 1;  
var mc = \_root.box;  
boxTween = new mx.transitions.Tween(mc, “\_width”, easeType, beginX, contentW, time, true);  
boxTween = new mx.transitions.Tween(mc, “\_height”, easeType, beginY, contentH, time, true);  
};  
scaleTween(contentW, contentH);  
i = 0;  
blueButton.onPress = function () {  
\_root.picLoader.loadClip(\_root.imageDat[0], “\_root.picHolder”);  
}

//////  
For some reason the onLoadProgress doesn’t function and the onLoadComplete function executes even though the data isn’t loaded, does anyone know why??? :q:
