# Background won't retile on stage resize

**URL:** <https://forum.kirupa.com/t/background-wont-retile-on-stage-resize/249978>\
**Category:** flash\
**Created:** [January 24, 2008, 3:38am UTC](https://forum.kirupa.com/t/background-wont-retile-on-stage-resize/249978 "2008-01-24T03:38:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)\
**Post date:** [January 24, 2008, 3:38am UTC](https://forum.kirupa.com/t/background-wont-retile-on-stage-resize/249978/1 "2008-01-24T03:38:34Z")

</div>

Not sure what I’m doing wrong here. It will tile when the page loads, but won’t re-tile when the browser is resized.

```auto

package {
	
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.display.Bitmap;
	import flash.geom.Rectangle;
	import flash.events.*;
	
public class Index extends Sprite {
		
		private var backGround:Sprite;

       public function Index():void {
			
			init();
			
       }
		
       private function init():void {
			
		tileBG();

		stage.addEventListener(Event.RESIZE, tileBG);
       }

       private function tileBG(e:Event = null):void {
				
		var oldTile:Sprite = backGround;
			
		backGround = new Sprite();
		backGround.graphics.beginBitmapFill(new Tile(0, 0));
		backGround.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
		backGround.graphics.endFill();
		addChild(backGround);
			
		if (oldTile != null && oldTile != backGround) {
			removeChild(oldTile);
		}
			
	}

}

```
