Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background color of a text box? 1

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Hi,

Does anyone know if its possible to set a background colour to a dynamic text box without having to place a colored box behind the text?

Alternatively, if not, is there a way in actionscript to specify a symbol's width to be equal with the width of a dynamic text box.

Thanks in advance!
 
You can in MX.

But guess you want this for 5, right? Regards,

oldman3.gif
 
Think a colored box (in fact in a movie clip) is the only way it can be achieved. You could play with the clip's visibility... But why would you want to change it's size with AS? Regards,

oldman3.gif
 
Ok the problem is scrolling text that needs to be updated by the user via web form. which will be in a .txt file, loaded into flash. Because the width of the text box will be undeterminable due to the user inputting the text and changing it i need a background box/color to resize to the width of the text box and thus scroll with the text and form a background behind the text.
 
To my knowledge you can't dynamically change the size of a textbox. In 5, it is set in the Flash movie once and for all. You can change the content when loading a new textfile, but scroll buttons should take care of the rest. The textbox itself won't become any wider than it was. Regards,

oldman3.gif
 
Ah I see, so what would be the way in FlashMX?
 
In MX you now have the textfield object, so you can change it's properties as any other symbol.

my_text._width = 400;
my_text.backgroundColor = 0xFF0000; Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top