Resizing Tiled Background in Flash 8

Hello,

I’ve checked out this tutorial, and it’s great:

http://www.kirupa.com/developer/flash8/tiledbackground_flash8.htm

But, is there a way, to make the background scale, when you resize the movie. I made this AS code:

import flash.display.BitmapData;
var tile:BitmapData = BitmapData.loadBitmap("pattern");
this.beginBitmapFill(tile);
this.lineTo(Stage.width, 0);
this.lineTo(Stage.width, Stage.height);
this.lineTo(0, Stage.height);
this.lineTo(0, 0);
this.endFill();
//-----------------------
sizeListener = new Object();
sizeListener.onResize = function() {
var tile:BitmapData = BitmapData.loadBitmap("pattern");
this.beginBitmapFill(tile);
this.lineTo(Stage.width, 0);
this.lineTo(Stage.width, Stage.height);
this.lineTo(0, Stage.height);
this.lineTo(0, 0);
this.endFill();
};
Stage.addListener(sizeListener);

But it doesn’t work… :frowning: I’m confused, what should I do?..