# Use bitmap as a colour With Code?

**URL:** <https://forum.kirupa.com/t/use-bitmap-as-a-colour-with-code/324129>\
**Category:** flash\
**Created:** [August 3, 2011, 8:48pm UTC](https://forum.kirupa.com/t/use-bitmap-as-a-colour-with-code/324129 "2011-08-03T20:48:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cortezcreations](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@cortezcreations](https://forum.kirupa.com/u/cortezcreations)\
**Post date:** [August 3, 2011, 8:48pm UTC](https://forum.kirupa.com/t/use-bitmap-as-a-colour-with-code/324129/1 "2011-08-03T20:48:04Z")

</div>

Hey there.  
Been awhile for a flash as2 question, but came upon a new one today.  
I am creating a little drawing app for an online contest using lineStyle and moveTo with a selected colour controlled by the hex values eg 0x000000.

Nothing unusual there, but I was then asked if I could make one of the colours with a glitter. As it doesn’t need to be animated I was hoping there was a way to reference an image to paint with.

Is this possible with AS alone? I know I can easily set the fill colour to an image when working within the fla but never attempted to reference via a swf before with AS.

Would this be achievable via the BitmapData class?  
Or should I add the image as a background to the clip and use the brush as a mask?

Any advice would be greatly appreciated.  
Cheers
