Solved

Change color of dynamic text header with ActionScript

Posted on 2004-09-29
8
217 Views
Last Modified: 2010-04-03
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
Comment
Question by:grinchikins
  • 3
  • 3
  • 2
8 Comments
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12187048
header..textColor = 0xFF0000;
 //remove the "." between text & Color...
0
 
LVL 6

Assisted Solution

by:nishasrilankan
nishasrilankan earned 25 total points
ID: 12187074
give an Instance name to the TextBox...say Text1,

_root.Text1.textColor = 0xFF0000;
0
 

Author Comment

by:grinchikins
ID: 12192142
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
 
LVL 39

Accepted Solution

by:
blue-genie earned 25 total points
ID: 12198277
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:grinchikins
ID: 12203262
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
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12206778
Check your publish settings...

Select the flash player version heigher than version 5...
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12215083
are you developing for flash 5 player?
0
 

Author Comment

by:grinchikins
ID: 12226873
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Inserting a pop up image to a scanned PDF 5 434
Flash Slides/Presnetation 4 71
Adobe Flash Player won't install on Windows 7 3 228
flash in chrome 4 86
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now