i’m trying to load a bitmap using this:
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:
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?