BitmapData onto Irregular Shape

How can I attachBitmap to an irregular shape?

I load a pattern into my movie (pattern.jpg), it is a square image 500x500. I want to draw that image onto an irregular shape. If I do the following it simply shows the large square overtop of my shape. The pattern isn’t actually applied to my shape.

var bitmap:BitmapData = new BitmapData(500, 500, true, 0x00000000);
myShape.attachBitmap(bitmap,1,"auto",true);
bitmap.draw(pattern);

Any Ideas?

Thanks