Simple problem, can this be done?

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:


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?


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