Generating hitArea programmatically from BitmapData

How can I create a complex hitArea for a Sprite
starting from alphachannel data of a dynamically loaded image?

Either
If I apply the image (wrapped in a Sprite) as the hitArea
or
If I apply the image as a simple mask

mousevents gets triggered in the rectangular area
that has the dimension of the loaded image.

In the authoring environment solution is simple…

  • take the image
  • do a trace bitmap
  • use the traced bitmap as hitArea in a SimpleButton.

It’s in ActionScript that I’m having problems…
I think that’s because I’m still working
with the BitmapData of the image (that is rectangular)
But how can I obtain a Shape from the alphachannel data
of the image I loaded?
The idea is to use this arbitrarily complex Shape
(wrapped in a Sprite) as a dynamically generated hitArea?

Have you ever tried something like that?
Is that even possible?
Using Actionscript shouldn’t I have access to all that
could be done in the authoring environment?

Any suggestions
Thanks
Jo