How to make transparent background in text fields

actionscript-3flash

Say, i have a text field with some text in it, and i want to make it have a backgruond with alpha value (as in partially transparent, not sure how to make it sound good ^^). This text field reacts to mouse events, such as clicks and rolls out/over, and each event changes the background color.

I've done some digging and ran across flash.text.TextField.backgroundColor and flash.text.TextField.background properties of text fields. They're cool, but not enough to solve the problem. And obviously, if I change the text field's alpha value, the text will also become transparent.

I know I can create a movieclip below the text field and alter its properties to acheive my goal, but I'm wondering if there is a simpler way.

Thanks in advance

Best Answer

With TLFTextField you have backgroundAlpha that you can use.

You can also try including the alpha in your color value, like 0x99FF0066, notice the 99, a good read on the subject can be found here:

http://myflex.wordpress.com/2007/09/07/about-hex-color-codes-in-flex-as3/

Related Topic