# Fill a movieclip with loadBitmap

**URL:** https://forum.kirupa.com/t/fill-a-movieclip-with-loadbitmap/281768
**Category:** flash
**Created:** [February 13, 2009, 2:08am UTC](https://forum.kirupa.com/t/fill-a-movieclip-with-loadbitmap/281768 "2009-02-13T02:08:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![asthyanax](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@asthyanax](https://forum.kirupa.com/u/asthyanax)
#### Post date: [February 13, 2009, 2:08am UTC](https://forum.kirupa.com/t/fill-a-movieclip-with-loadbitmap/281768/1 "2009-02-13T02:08:51Z")

</div>

Hi,  
I have a question about loadBitmap. I want to fill a movieclip with a tiled background but it looks kinda weird. It’s all streched out. If I use Stage.width and Stage.height it looks great but of course it’s not what I want since I want only that movieclip. I tried with a mask but then when I try to test myMovieClip.\_width it equals Stage.width.  
Here’s my code:

```php

function tileBg(mc:MovieClip,w:Number,h:Number,bg:String):Void {
    var tile:BitmapData = BitmapData.loadBitmap(bg);
    trace("TILE BG= "+ tile);
    mc.beginBitmapFill(tile);
    mc.moveTo(0,0);
    mc.lineTo(w,0);
    mc.lineTo(w,h);
    mc.lineTo(0,h);
    mc.lineTo(0,0);
    mc.endFill();
}
tileBg(myClip,myClip._width,myClip._height,''tile")

```

Any help would be great.  
Thank you.
