Draw a bitmap line or a bitmap polygon

I need to create a flash/flex/ActionScript3 program that allows user to draw lines and polygons with legends. The legends are provided as bitmap. I’m thinking that I have to use bitmapfill to do the work. Is this the best approach?

As the line may change the direction, I will need the bitmapfill to change direction following the direction of the line. What is the best way to do this? Any example out there?

For polygons, can we use bitmapfill to fill irregular shapes?

Thanks,
-Maggie