# MovieClipLoader Class

**URL:** https://forum.kirupa.com/t/moviecliploader-class/298496
**Category:** flash
**Created:** [October 20, 2009, 8:48am UTC](https://forum.kirupa.com/t/moviecliploader-class/298496 "2009-10-20T08:48:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NovemberRain](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@NovemberRain](https://forum.kirupa.com/u/NovemberRain)
#### Post date: [October 20, 2009, 8:48am UTC](https://forum.kirupa.com/t/moviecliploader-class/298496/1 "2009-10-20T08:48:26Z")

</div>

Hi,

I’ve movieclip loader class to load two swf files to the stage. It’s working fine but need to add a preloader for both separately. Is it possible to pass that loading status to the holder clips to show that. see below the code

```auto

/ ********************************************************************* /
//init
var myMCL = new MovieClipLoader();
/ ********************************************************************* /
//callbacks
myMCL.onLoadStart = function(targetMC) {
 var loadProgress = myMCL.getProgress(targetMC);
 myTrace("The movieclip "+targetMC+" has started loading");
 myTrace("Bytes loaded at start="+loadProgress.bytesLoaded);
 myTrace("Total bytes loaded at start="+loadProgress.bytesTotal);
 myTrace(" ____________________________________");
};
myMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
 myTrace("movie clip: "+targetMC);
 myTrace("Bytes loaded at progress callback="+loadedBytes);
 myTrace("Bytes total at progress callback="+totalBytes);
 myTrace(" ____________________________________");
 _root.percentDone.text = int ((loadedBytes/totalBytes)*100);
 tracker = int ((loadedBytes/totalBytes)*100);
 trace("testing...");
};
myMCL.onLoadComplete = function(targetMC) {
 myTrace(targetMC+" has finished loading.");
 var loadProgress = myMCL.getProgress(targetMC);
 myTrace("Bytes loaded at end="+loadProgress.bytesLoaded);
 myTrace("Bytes total at end="+loadProgress.bytesTotal);
 myTrace(" ____________________________________"); 
};
myMCL.onLoadInit = function(targetMC) {
 myTrace("Movie clip:"+targetMC+" is now initialized");
 targetMC._width = 170;
 targetMC._height = 170;
 myTrace(" ____________________________________");
};
myMCL.onLoadError = function(targetMC, errorCode) {
 myTrace("ERRORCODE:"+errorCode);
 myTrace(targetMC+"Failed to load its content");
 myTrace(" ____________________________________");
};
/ ******************************************************************** /
//load the files in to their respective targets
myMCL.loadClip("test1.swf", "_root.myMC1");
myMCL.loadClip("test2.swf", "_root.myMC2");

```

In this code myMC1 and myMC2 (see bottom lines of code) are instance of a sigle movieclip. Is it possible to set a dynamic text field inside that to show that loading status. :sigh:
