TextField.backgroundColor Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
TextField.backgroundColor Property Flash 6

RGB number specifying the text field's background color read/write
theField.backgroundColor

Description

The integer backgroundColor property sets the color of a text field's background. Colors are specified as a single number, most commonly a six-digit hexadecimal value of the form 0xRRGGBB, where RR, GG, and BB are two-digit numbers between 00 and FF, representing the Red, Green, and Blue components. For example, the RGB triplet (R: 51, G: 51, B: 102) is equivalent to the hexadecimal value:

0x333366

The default value is white (0xFFFFFF). For more information on RGB triplet notation, see the Color class.

The backgroundColor property has a visible effect only when the background property is true; when background is false, no background is shown, even if backgroundColor is set. For example, the following code tries to set the background color of theField_txt to blue, but the color does not appear because background is not yet set:

this.createTextField("theField_txt", 1, 0, 0, 200, 20); theField_txt.text = "this text has a blue background"; theField_txt.backgroundColor = 0x0000FF;

To make the blue background appear, we must add the following line:

theField_txt.background = true;

Setting the value of background does not alter the value of backgroundColor.

See Also

TextField.background, TextField.border, TextField.borderColor, the Color class



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net