Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding background color to Dynamic Text boxes

Community Beginner ,
Jun 10, 2011 Jun 10, 2011

Is this possible?  Basically I want to make the background of the Dynamic Text box have a color.  How do I do this using AS3?

TOPICS
ActionScript
5.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 10, 2011 Jun 10, 2011

if your textfield has reference name tf, use:

tf.background=true;

tf.backgroundColor=0xrrggbb;

Translate
Community Expert ,
Jun 10, 2011 Jun 10, 2011

if your textfield has reference name tf, use:

tf.background=true;

tf.backgroundColor=0xrrggbb;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 10, 2011 Jun 10, 2011

Thanks Kglad.  Works if you put quotes around the hex color.

tf.background=true;

tf.backgroundColor="0xrrggbb";

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2011 Jun 10, 2011

you don't need quotes and, strictly speaking, you shouldn't use quotes.  color is a uint though flash will convert the string to a uint, if it can.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 14, 2020 Nov 14, 2020

Would this be different for html5 cancas? 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 14, 2020 Nov 14, 2020
LATEST

it sure would.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines