# Tile pattern

**URL:** <https://forum.kirupa.com/t/tile-pattern/294896>\
**Category:** Uncategorized\
**Created:** [August 21, 2009, 3:56pm UTC](https://forum.kirupa.com/t/tile-pattern/294896 "2009-08-21T15:56:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lope](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lope](https://forum.kirupa.com/u/lope)\
**Post date:** [August 21, 2009, 3:56pm UTC](https://forum.kirupa.com/t/tile-pattern/294896/1 "2009-08-21T15:56:09Z")

</div>

I want to tile a pattern acros the stage, but I want to load it with loader (png file).

I used to do it like that, \*\*Tile \*\*being bitmap in the library with export name **Tile**

```auto

var pattern:Sprite = new Sprite();
addChild(pattern);
var g:Graphics = pattern.graphics;
function resizeHandler(event:Event=null):void
{
    var sw:Number = stage.stageWidth;
    var sh:Number = stage.stageHeight;

    g.clear();
    g.beginBitmapFill(new **Tile** (0, 0));
    g.drawRect(0, 0, sw, sh);
    g.endFill();
}

```

but now i need to load that png first:

```auto
function completeHandler(event:Event):void {
       var image:Bitmap = Bitmap(loader.content);
       _bitmapData=new BitmapData(image.width, image.height);
       _bitmapData.draw(image);
}

```

what do i need to do actually to send this to beginBitmapFill ?
