Hello....
I'm not sure if this is exactly what you're looking for, but this is what i've used in the past.
I've use the BitmapData class in this.
This will apply a tiled background that doesn't stretch but rather keeps refilling the screen and also centers the content (called centerimg in this example) and doesn't scale it.
for this to work properly, put your background clip into the library and give it a linkage identifier of "tile" (or whatever else you choose, just make sure to update the AS)
Code:
import flash.display.BitmapData;
centerimg._x = Stage.width/2;
centerimg._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();
centerimg._x = Stage.width / 2;
centerimg._y = Stage.height / 2;
}
Bookmarks