# Simple problem, can this be done?

**URL:** <https://forum.kirupa.com/t/simple-problem-can-this-be-done/282591>\
**Category:** flash\
**Created:** [February 24, 2009, 12:07am UTC](https://forum.kirupa.com/t/simple-problem-can-this-be-done/282591 "2009-02-24T00:07:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michdd](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@michdd](https://forum.kirupa.com/u/michdd)\
**Post date:** [February 24, 2009, 12:07am UTC](https://forum.kirupa.com/t/simple-problem-can-this-be-done/282591/1 "2009-02-24T00:07:13Z")

</div>

I have bitmaps in the library that are labeled like… hair\_1\_6 where 1 would be the hairStyleId and 6 would be the hairColorId. Previously I had a switch() to change the bitmap used for hairColorId. But it would be easier if I could just could just make one statement that could set the bitmap source directly.

For example:

```auto

var hairBitmap:BitmapData;
hairBitmap = new hair_1_1(0,0) as BitmapData;

```

My idea was this: Accept the syntax is incorrect in this case, is there a way to do what I want?

```auto

hairBitmap "hair_" + hairStyleId + "_" + hairColorId(0,0) as BitmapData;

```
