Solved

Change color of dynamic text header with ActionScript

Posted on 2004-09-29
8
222 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
Industry Leaders: 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!

 
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
 

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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
flash cs6 4 349
Flash movie or gif/animation? 3 941
Movies become choppy/laggy after playing for 5 episodes or more 8 112
Some You tube not working in IE11 on Windows 10 and 8.1 5 92
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

685 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