Wednesday, December 9, 2009

Setting a background fill color in a Sprite

While extending components, it might be useful to set the background color to something. The Sprite in Flex does not provide a backgroundColor property as do UIComponents. But the background can be set just as easily using the "opaqueBackground" property.

All you need to do is:

mySprite.opaqueBackground = my_color;

* my_color can be a uint or a hex color String.

No comments :