Search code examples
flashapache-flexdrawflex-sparkbitmapdata

How to use bmpdata.draw(component); on Flex 4 SPARK components?


So I try to say bmpdata.draw(backgroundRect); to dray on my Bitmap my component but Flash Builder gives me this and I do not know what to do...

1067: Implicit coercion of a value of type spark.primitives:Rect to an unrelated type flash.display:IBitmapDrawable. Flex Problem

Please help


Solution

  • You have to use backgroundRect.displayObject. You might wanna set

    backgroundRect.displayObjectSharingMode = DisplayObjectSharingMode.OWNS_UNSHARED_OBJECT