# Bitmapfilling custom shape

**URL:** <https://forum.kirupa.com/t/bitmapfilling-custom-shape/285398>\
**Category:** flash\
**Created:** [March 31, 2009, 10:45am UTC](https://forum.kirupa.com/t/bitmapfilling-custom-shape/285398 "2009-03-31T10:45:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjeet\_naidu](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@ranjeet\_naidu](https://forum.kirupa.com/u/ranjeet_naidu)\
**Post date:** [March 31, 2009, 10:45am UTC](https://forum.kirupa.com/t/bitmapfilling-custom-shape/285398/1 "2009-03-31T10:45:15Z")

</div>

Hi guys am in a bit of a mess here.:hr:  
Here is what am trying to do.

createDuplicate function helps me to create a duplicate movieclip. Now I want to bitmap fill this duplicate mc. Is this possible? Am so confused please help…

```auto

        private function createDuplicate(mc:MovieClip):Sprite
        {
            var thisBitmapData:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x00000000);
            thisBitmapData.draw(mc);
            
            var thisBitmap:Bitmap = new Bitmap(thisBitmapData);
            thisBitmap.smoothing = true;
            
            var newInstance:Sprite = new Sprite();
            newInstance.cacheAsBitmap = true;
            newInstance.addChild(thisBitmap);
            
            return newInstance;
        }

```

Cheers
