Dynamic Background Bitmap

I got the following code from gotoandlearn.com and found it very useful. How would you make this code work with loading the jpg in externally rather than importing it every time and giving it a linkage identifier in the library?



import flash.display.BitmapData;

cover._x = Stage.width / 2;
cover._y = Stage.height / 2;

var tile:BitmapData = BitmapData.loadBitmap("tile");

function fillBG() {
    this.beginBitmapFill(tile);
    this.moveTo(0,0);
    this.lineTo(Stage.width,0);
    this.lineTo(Stage.width,Stage.height);
    this.lineTo(0,Stage.height);
    this.lineTo(0,0);
    this.endFill();
}

fillBG();

var stageL:Object = new Object();
stageL.onResize = function() {
    fillBG();
    cover._x = Stage.width / 2;
    cover._y = Stage.height / 2;
}

Stage.addListener(stageL);