# Preload using MovieClipLoader

**URL:** <https://forum.kirupa.com/t/preload-using-moviecliploader/237449>\
**Category:** Uncategorized\
**Created:** [August 30, 2007, 1:25pm UTC](https://forum.kirupa.com/t/preload-using-moviecliploader/237449 "2007-08-30T13:25:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwiniquit](https://avatars.discourse-cdn.com/v4/letter/i/7993a0/32.png) [@iwiniquit](https://forum.kirupa.com/u/iwiniquit)\
**Post date:** [August 30, 2007, 1:25pm UTC](https://forum.kirupa.com/t/preload-using-moviecliploader/237449/1 "2007-08-30T13:25:14Z")

</div>

i’m trying to load a bitmap using this:  
[http://www.kirupa.com/developer/actionscript/moviecliploader2.htm](http://www.kirupa.com/developer/actionscript/moviecliploader2.htm)

it seems like the preload is working fine. i’m just having trouble loading the bitmap from here. it works without the preloader but i can’t figure out what’s not making it load when it’s done. here’s the code:

```auto
function loadTransBitmap(id){
    this.createEmptyMovieClip("holder_img", this.getNextHighestDepth());

    var mcl:MovieClipLoader = new MovieClipLoader();
    preload = new Object();
    
    mcl.addListener(preload);
    
    preload.onLoadStart = function(targetMC) {
        trace("started loading "+targetMC);
    };
    
    preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
        trace("% "+Math.round((lBytes/tBytes)*100));
    };
    
    preload.onLoadComplete = function(targetMC) {
        var temp_mc = this.createEmptyMovieClip("temp_clip", this.getNextHighestDepth());
        var tempbmp:BitmapData = new BitmapData (holder_img._width, targetMC._height);
        trace(targetMC._width);
        tempbmp.draw(targetMC);
        transbmp.copyPixels(tempbmp, tempbmp.rectangle, basepoint);
        tempbmp.dispose();
        
        trace(targetMC+" finished");
        mcl.unloadClip(holder_img);
        mcl.removeListener(preload);
    };
    mcl.loadClip(id, holder_img);
}

```

i noticed after the load is complete, i traced the width for targetMC, which is where the image should be preloaded…and it comes up as 0. so it seems like there’s nothing in the holder\_img container. but it preloads something so i don’t know what the problem is.

also: ‘id’ from the function is just the image (images/1.jpg)

any ideas?
