Hi everyone

I'm having problems trying to figure this out, I've tried a couple of things but nothing works for me.

I could for sure use the help.

I have this code that loads and scales an image to full browser.

code example:

Code:

Code:
Stage.scaleMode ="noScale";
Stage.align = "LT";


import flash.display.*;

function loadBitmapSmoothed(url:String, target:MovieClip) {

    var bmc:MovieClip = target.createEmptyMovieClip(
        "bmc",
        target.getNextHighestDepth()
    );
    
    var listener:Object = new Object();
    listener.tmc = target;
    
    listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
        percent = Math.round((bytesLoaded/bytesTotal)*100);
        pText.text = percent+"%";
    }
    
    listener.onLoadInit = function(mc:MovieClip) {
        mc._visible = false;

        var bitmap:BitmapData = new BitmapData(
               mc._width,
            mc._height,
            true
        );

         this.tmc.attachBitmap(
            bitmap, 
            this.tmc.getNextHighestDepth(),
            "auto", 
            true
        );
         bitmap.draw(mc);        
         
        // set size and position on load
        if(Stage.height/Stage.width > target._height/target._width) {
            img_prop = target._width/target._height;
            target._height = Stage.height;
            target._width = Stage.height*img_prop;
            target._y = (Stage.height/2)-(target._height/2);
            target._x = (Stage.width/2)-(target._width/2);
        } else {
            img_prop = target._height/target._width;
            target._width = Stage.width;
            target._height = Stage.width*img_prop;
            target._y = (Stage.height/2)-(target._height/2);
            target._x = (Stage.width/2)-(target._width/2);
        }
    };
 
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.addListener(listener);
    loader.loadClip(url, bmc);
}


loadBitmapSmoothed("image.jpg", bg_con);




// set size and position on resize

var stage_listener:Object = new Object();

stage_listener.onResize = function():Void {
        if(Stage.height/Stage.width > bg_con._height/bg_con._width) {
            img_prop = bg_con._width/bg_con._height;
            bg_con._height = Stage.height;
            bg_con._width = Stage.height*img_prop;
            bg_con._y = (Stage.height/2)-(bg_con._height/2);
            bg_con._x = (Stage.width/2)-(bg_con._width/2);
        } else {
            img_prop = bg_con._height/bg_con._width;
            bg_con._width = Stage.width;
            bg_con._height = Stage.width*img_prop;
            bg_con._y = (Stage.height/2)-(bg_con._height/2);
            bg_con._x = (Stage.width/2)-(bg_con._width/2);
        }
}



Stage.addListener(stage_listener);
And I believe thats this is the portion of this code that loads an image into a movie clip container named "bg.con"

Code:

Code:
loadBitmapSmoothed("image.jpg", bg_con);

Now... I have this photo gallery who's pictures I would like to have loaded an scaled by the above code.

this is the code from the gallery that loads pictures into an containers named "img1":

Code:

Code:
stop();
if (_root.contenturl1 == "") {
	loadMovie("img1" + _root.zimgpage + ".jpg", "img1");
} else {
	loadMovie(_root.contenturl1 + "/" + _root.userid + "/img1" + _root.zimgpage + ".jpg", "img1");
}
I'd like to edit the first code so it loads the image path of the the second code into "bg_con" container.

any help would be appreciate it.

thank you