Draw a bitmap line or a bitmap polygon

[COLOR=black]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?[/COLOR]

[COLOR=black]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?[/COLOR]

[COLOR=black]For polygons, can we use bitmapfill to fill irregular shapes?[/COLOR]

Thanks,
-Maggie