# Tiled Bg Problem

**URL:** <https://forum.kirupa.com/t/tiled-bg-problem/266114>\
**Category:** flash\
**Created:** [July 16, 2008, 1:06pm UTC](https://forum.kirupa.com/t/tiled-bg-problem/266114 "2008-07-16T13:06:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anix](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anix](https://forum.kirupa.com/u/anix)\
**Post date:** [July 16, 2008, 1:06pm UTC](https://forum.kirupa.com/t/tiled-bg-problem/266114/1 "2008-07-16T13:06:51Z")

</div>

Hi i am currently designing a flash section for my site and i needed the Bg to be tiled however when i use the tiling code the tiles are displayed correctly except for the fact that the tiles are now covering all the other elements on the stage so that alls i can see are tiles. the tile code i am using is below i would appreciate it if any1 knows how i might display the tiles behind all other elements on my stage thanks

```auto
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
 
stage.addEventListener(Event.RESIZE, tileBG);
 
var tile:Sprite;
 
function tileBG(event:Event=null):void {
 
    
    var oldTile:Sprite = tile;
 
    
    tile = new Sprite();
 
    
    tile.graphics.beginBitmapFill(new Pattern(0, 0));
    tile.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
    tile.graphics.endFill();
 
    
    addChild(tile);
 
    
    if (oldTile != null && oldTile != tile) {
        removeChild(oldTile);
    }
}
 
tileBG();

```
