• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

Change color of dynamic text header with ActionScript

Hi there,
I have a header which I want to change the color of, depending on which variable is imported, using ActionScript.  I have a dynamic text box named variable "header" which I can alter the text of by simply using: header = "this page" but I cannot seem to change the color.  I would have thought that simply adding:
header.color = FF0000
or
header.text.color = FFF0000
would work but it doesn't.
Thanks
Charles
0
grinchikins
Asked:
grinchikins
  • 3
  • 3
  • 2
2 Solutions
 
nishasrilankanCommented:
header..textColor = 0xFF0000;
 //remove the "." between text & Color...
0
 
nishasrilankanCommented:
give an Instance name to the TextBox...say Text1,

_root.Text1.textColor = 0xFF0000;
0
 
grinchikinsAuthor Commented:
Sorry,  tried that and it doesn't work.  I already have the instance name working for putting in text. At the moment:

Text1 = "\"A\" Companies"
Text1.textColor = 0xFF0000;

Shows "A" Companies - text that I want, but the color remains the same as entered in the text box not 0xFF0000.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
blue-genieCommented:
grinchikins, i suspect you dont' have an instance name given to your textfield, (bottom left corner of the properties window when you select the text field on the stage), but rather you have assigned a var value to it (on the bottom right), the reason I say this is

if your textfield had a textfield instance name of Text1, your script would have to read

Text1.text =  "\"A\" Companies"
 therefore, leave the variable as Text1 or header, and give it a different instance name.

for example, if your var value is "header" and the instance name is Text1, then your code will read as follows:

header = "\"A\" Companies";
Text1.textColor = 0xFF0000;

thats all.
blu.

0
 
grinchikinsAuthor Commented:
I have tried that, but all it does is give me dire warnings in both a popup and the output window that this feature is not supported in the Flash 5 Player.  Still doesn't change the color.  I am using Flash MX, by the way (not 2004).
0
 
nishasrilankanCommented:
Check your publish settings...

Select the flash player version heigher than version 5...
0
 
blue-genieCommented:
are you developing for flash 5 player?
0
 
grinchikinsAuthor Commented:
Okay, so you're both right.  Now I don't know who to give the 50 points to.  I initially was developing this for the Flash 5 player because I started this project so many years ago I was concerned that not many people had upgraded to the Flash 6 player but I assume I should forget about that now.  I guess this couldn't be done before MX.  Seems silly that you couldn't attach an instance name to dynamic text.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now