Changing Color Of Text That Is Variable
I am using Flash MX Pro. I have a movie clip with text loading from a variable.Is there any way to change the color of the text. i have tried everything and it seems to have no affect. One tutorial I read said to make sure the actionscript was in expert mode and how to do it. Problem is my version does not have that option.
If anyone can tiell me how to change the color of the text, I would be very grateful.
Taz
FlashKit > Flash Help > Flash MX
Posted on: 10-17-2005, 07:10 PM
View Complete Forum Thread with Replies
Sponsored Links:
Changing Color Of Text In String Variable
Hi,
I have a variable called fx:
house = "The house is a big 4 room house. Read more";
okay, - then I have a dynamic text field where I want my text.
Okay my text field var is also called house and I get the text all right,- BUT
I want the 'Read more' part to have another color than the rest and also a link.
How can I do that???
Regards
Godowsky
View Replies !
View Related
Changing Text Color
Hi all:
I have a menu of links in my Flash MX movie. All of the links connect to different areas within the movie; none of them call external HTML pages.
Each link is a dynamic text box covered by an invisible button. I use a script to populate the boxes. For example:
_root.linkText1.htmlText = "<u>File 1, Section 1</u>";
_root.linkText2.htmlText = "<u>File 1, Section 2</u>";
_root.linkText3.htmlText = "<u>File 1, Section 3</u>";
(Note that my code actually has proper HTML tags. This editor keeps literally formatting it, and I don't know how to turn the feature off.)
The links are colored blue, and I would like for only the visited links to change to purple. I can't get it to work.
I tried adding a property called "visited" to the Text Field class. At the beginning of the movie, I added a default property as follows:
TextField.prototype.visited = false;
When each link is clicked, this script runs:
_root.linkText1.visited = true;
_root.linkText1.htmlText = "<font color="#990099">File 1, Section 1</font>";
The link won't change to purple, though. Each time I return to the Menu, it's still blue, and the value of "visited" shows as false.
I have also tried creating and running a function to iterate through the links, but it doesn't work, either. I don't get errors--just no results.
Here's the function. I modeled it after an example in the ActionScript Bible:
fieldNames = ["linkText1", "linkText2", "linkText3", "linkText4", "linkText5", "linkText6", "linkText7", "linkText8", "linkText9", "linkText10"];
function checkFields(target, list){
var list = fieldNames;
for(i=0; i<list.length; i++){
currentValue = list[i].visited;
if(currentValue == true){
trace(currentValue);
}
}
}
The AS Bible didn't explain what the "target" parameter is used for.
Please help.
View Replies !
View Related
Changing Text Color
It doesn't seem to work
I have a function which argument is supposed to ) change text color of dynamic text named _root.where
This is the function
function changecolor (colorr) {
text=new Color(_root.where);
text.setRGB(color);
}
and button which gives this action
on(release){_root.changecolor(FF0000);}
But my dynamic text does not change color.
What am i doing wrong, is it even possible to change color of dynamic text?
P.S. Text is black and it's in _root.
Thanx
View Replies !
View Related
Changing Text Color. Help?
I am making a 'dress-up' game and one of the fields is 'Emblem.' For one of the emblems, there is a text box where you type in a character the press submit and it shows up as the persons shirt mark. I was thinking, and now wondering, if there's a way to change the text color with an action and without breaking apart the text. Help would be greatly appriciated.
View Replies !
View Related
Changing The Color Of Text
Hi, I am tring to change color of text..
the thing is ,if the answer is true then the color=blue else it is red
how do I modify the code ?
thanks
PHP Code:
_root["sonuc"+i].htmlText='<font color="blue">good job</font>';
View Replies !
View Related
Changing Text Color With XML
Greetings Everyone,
I have been tasked with creating a dynamic banner. The banner loads text from an XML File. I have been able get text boxes to displaythe text. However I am trying to change the color of the text. I am trying to put the value of '0xFF00CC' which is loaded from the same XML file as the banner text. When I try to place that number into a variable and then trace the variable it is coming back 'undefined'.
Any help would be greatly appreciated!
Jesse
View Replies !
View Related
Changing Text Color
I am attempting to change the color of text on a mc during mouse over. The mc is dynamically created with XML and is being used as a button. I am at a loss. I have an event listner for the mouse over state however I can not get the text color to change with the mouse over. The mouse over is functioning properly, as I have other events being triggered the work.
Any help will be greatly appreciated.
View Replies !
View Related
Changing Text Color
This actionscript isn't changing the text color on rollover, what am I doing wrong?
ActionScript Code:
button.txt.text = "Back to Gallery";
button.onRollOver =function() {
var rolloverTxt = new TextFormat();
rolloverTxt.color = "0xFFCC00";
this.txt.setNewTextFormat(rolloverTxt);
}
View Replies !
View Related
Changing Text Color
I am using a countdown clock and would like to know how to change the color of the text based on the time on the clock. For example every time it hits 10 whether its in ms, sec, min etc. I would like the text to change from yellow to red then when it gets past zero I want it to reset to yellow. Any ideas on how to do this?
Thanks
View Replies !
View Related
Help With Changing Text Color
ok, so this is for a baseball leauge that i take part in. They wanted to do a live update thingy on there site. What i want to do is make it so that when the game status variable = final then the text color changes of the team that lost.
Code:
onClipEvent (enterFrame) {
if(_root.game_status == "Final"){
if(_root.home > _root.away ){
format = new TextFormat();
format.color = 0xFF3366;
hteam.setTextFormat(format);
}else{
format = new TextFormat();
format.color = 0xFF3366;
ateam.setTextFormat(format);
}
}
}
That is what i have so far for it, but i cant get it to fit all together and actually work. Hopefully i explained it well enough, sorry bout that. thanx for any help that you can give me...
View Replies !
View Related
Changing Text Color With AS
Is there a way you can change a text objects color with AS? For example… Giving the text object the instant name: “my text”. Then changing the color of that instant name??? The way I have been doing this in the past is by making the text object a movie clip and just making a second key frame with the second color. However this means I now have a lot of movie clips floating around.
- Thank you very much.
View Replies !
View Related
? Text Color Isn't Changing?
I have created a simple countdown clock. I know that I can set the textfield color to red by simply selecting it and using the property inspector, but I want to change the color using actionscript.
I tried using
Textfield.textColor = 0xFF0000;
but for some reason the text isn't changing.
why?
Let me know what i'm doing wrong
Thanks,
Sam
View Replies !
View Related
Changing Combobox Text Color?
changing combobox text color?
thank you for reading this post and for any assistance provided.
My question is simply how to change the text color in the comboxbox.
Ive tried a few things, but none have seemed to work.
thanks in advance.
View Replies !
View Related
Changing Text Color Dynamicly?
Is there a way in F5, through ActioScript, to change the color of a font contained within a dynamic text field?
For instance, if I have on my stage a text field with a variable name of "link1", I'm wondering if I can on(rollOver)change my font color from say #999999 to #00FF00. Maybe through set property?????
View Replies !
View Related
Changing Color Of Input Text Box?
Is it possible to change the color of an input text box with using actionscript??
I really dont know if its possible. I just guessed and tried stuff like
message.color = "#FF00FF";
message being the variable name
I am also using Flash 5.
View Replies !
View Related
Changing Color Of Dynamic Text
I have a dynamic text box and two button. The buttons are: red and green. When I click red, the word "red" is printed in the box, and when green is clicked, "green" is printed.
The text box adds words. If I press red 4 times and green 3 times it would say:
"red red red red green green green"
Now, I want the red words to be printed in red, and the green words in green.
My code is the following (note the text box is named history text):
on (release) {
_root.historytext.textColor = ("0x990000");
_root.historytext.text = _root.historytext.text+ "
" + "red"
}
on (release) {
_root.historytext.textColor = ("0x0CC000");
_root.historytext.text = _root.historytext.text+ "
" + "green"
}
The problem with my code is that the entire text color in the box is changed. I need it so that when I add a green word, it is green, and a red is red.
THANKS!
View Replies !
View Related
Changing Dynamic Text Color
Hello. I'm having a problem with changing the color of text in a dynamic text box and making it permanent. Here's the code I'm using:
Code:
fmt1 = new TextFormat();
fmt1.color = 0xff0000;
_root.myText.setTextFormat(fmt1);
This code works fine up until the point that I change the text! I'm just wondering if there's a way to make it permanently red, or any color for that matter.
View Replies !
View Related
XML, Color Changing And Text Formatting.
If I've got a flash document that I'm bringing in XML information, into a running text block, is there a way for me to format the text at all?
can I add tags that will then change the color of the text, but only on items between the two tags.
I really don't have the ability to adjust the Flash document to have multiple text boxes to change the color, it has to be a big running block of text.
Any possibilities?
Thanks Thanks.
View Replies !
View Related
Changing Dynamic Text Color
Hello all,
I have a quick question. I have an array made up of nodes pulled from an XML file. Is it possible to change the text attributes (i.e. color or alpha) of one of these chunks of text.
So a very typical situation. XML is loaded into arrays. The text is loaded with a for loop into an empty movieslip. Looks like this:
text_obj.xmlNode1[n]
So lets say I want to do something to the color of array position 1. I set up a little function....
dummyButton.onPress = function(){
text_obj.xmlNode1[0].color = 0xff0000;
}
Seems like it should work, but doesn't Can I do this with dynamic text? Is there a workaround? I basically need to call out portions of the text during an animation. Think animated text highlighting.
Thanks!
View Replies !
View Related
CreateTextField And Changing Text Color
What im trying to do is: have a dynamically created text field change color when i roll over a movieclip.
This is what i have:
a movie clip with this code:
Code:
this.createTextField("header", 99, 10, 10, 100, 300);
header.autoSize = true;
header.embedFonts = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.size = 50;
my_fmt.color = 0x9A9A9A;
my_fmt.font = "Impact";
header.setNewTextFormat(my_fmt);
Now 2 instances of this moveiclip are placed inside another movieclip. Each one showing a different text. (these instance are to act like buttons)
INSTANCE 1:
Code:
onClipEvent (enterFrame)
{
this.header.text = "SOUP";
}
INSTANCE 2:
Code:
onClipEvent (enterFrame)
{
this.header.text = "PIZZA";
}
The dynamically created textfield (lets call it "header") works fine. However, i cannot seem to get the text field to change color once you roll over the instances. I've tried using "
Code:
on (rollover) {
this.header.textColor = 0xFFFFFF;"
}
, but no such luck....can anyone point me in the right direction.
Thanks.
View Replies !
View Related
Changing Text Color Through ComboBox
Hi,
I'm trying to develop a word processor in Flash. I have a ComboBox component, which has a list of colors like Red, Blue, etc. I also have an Input textbox, whose text colour i want to change based on the colour selected from the ComboBox. I'm using the following code but am not getting the result i want. Can anyone help ?
//cd is the name of the ComboBox
if (cb.selectedItem=="Red"){
// txt is the instance name of the movie clip containing the input text dt
myColor = new Color(_root.txt.dt.text);
_root.txt.dt.setNewTextFormat(myColor.setRGB(0xFF0000));
}
View Replies !
View Related
Changing Text Color With AS. Big Headache
I am having a hell of a time trying to get text to dynamical y change color. Here is the code that is giving me hell in its most basic form, I think it is pretty self-explanatory:
Code:
textbox.text = "hello";
newTextStyle = new TextFormat();
newTextStyle.color = "0xFF0000";
textbox.setTextFormat(newTextStyle);
View Replies !
View Related
Changing Text Color W/ Actionscript
Hi,
I am looking for a script that I can attach to a button that will then change the text (inside a dynamic text box) to a specified color. So, when I click the mouse on the button, the text in the dynamic text field will change to the color that I have specified in the script. Thanks so much for your help!
View Replies !
View Related
Changing Root Variable With Text Variable
Simple question: I'm trying to change the value of a variable on the _root level (called "myVar") to whatever a user types into a text box (mytextvar) on the stage. I have a button that says:
ActionScript Code:
on (press) {
_root.myVar = _root.myTextVar;
}
It isn't working... any ideas how to make this work?
View Replies !
View Related
Changing The Text Color On A Radio Button
Does anyone know how to change the color of the text on a radio button? the default black text does not show up very well on my movie background. I would like to change it to a gray color but can not figure out how. If anyone knows how to do this please let me know. thanks.
View Replies !
View Related
Changing Text Field Color On Focus
Hi there,
Is there a way to change the border and background color of a text field when it is focused on?
I know:
txtField.borderColor = 0x999999;
txtField.backgroundColor = 0xE3E3E3;
But how do I trigger it to change the color when the user clicks on the field?
Thanks!
View Replies !
View Related
[CS3] Changing Text Color In List Component?
Hallo,
Just switched over to CS3, still adjusting to the many many changes.
How on earth do you change the text color styles of a List component in AS3? I know it was easier to directly access the .color, .rollOverColor properties in AS2, but I can't find *ANY* comparable feature in AS3. I can see how everything else is skinned, by navigating the layers of symbols within the component. Can anyone help me, or explain how I'm thinking about this wrong?
Thanks,
Dylan
View Replies !
View Related
Changing Text Color In List Components
Hallo,
Just switched over to CS3, still adjusting to the many many changes.
How on earth do you change the text color styles of a List component in AS3? I know it was easier to directly access the .color, .rollOverColor properties in AS2, but I can't find *ANY* comparable feature in AS3. I can see how everything else is skinned, by navigating the layers of symbols within the component. Can anyone help me, or explain how I'm thinking about this wrong?
Thanks,
Dylan
View Replies !
View Related
Changing A Dynamic Text's Color After Using IF Statment.
Well here i will talk abit about changing a Dynamic Text's color after using IF statment.
The script is this way:
if ( name_field eq "") {
_root.status_field = " Please Type Your Name";
//here is the problem, the text should be red color,
}
so the text was in White color, but the message that will apear in the Status field should be red.
but what script should be used.
so any help here will be appriciated.
View Replies !
View Related
Changing Dynamic Text Color Through A Loop.
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
showdate = [];
showtime = [];
showlength = [];
showtitle = [];
showurl = [];
episodetitle = [];
episodeurl = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
showdate[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
showtime[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
showlength[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
showtitle[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
showurl[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
episodetitle[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
episodeurl[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
}
mainSchedule();
} else {
content = "file not loaded!";
}
}
bgdbuttons = Array()
bgds = new Array();
bgds.push()
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("info.xml");
function mainSchedule() {
if (loaded == filesize) {
for (var i=0; i<total; i++) {
this["show" + i].mc_time.text = showtime[i];
this["show" + i].mc_show.text = showtitle[i];
this["show" + i].mc_episode.text = "Episode:";
this["show" + i].mc_episodename.text = episodetitle[i];
this["show" + i].mcClick1.index=i;
this["show" + i].mcClick2.index=i;
this["show" + i].mcClick1.onRelease = function() {
getURL(_root.showurl[this.index]);
}
this["show" + i].mcClick1.onRollOver = function() {
_root.show[this.index].mc_show.color = 0x000000;
}
this["show" + i].mcClick2.onRelease = function() {
getURL(_root.episodeurl[this.index]);
}
}
}
}
View Replies !
View Related
Changing Dynamic Text Color Through A Loop.
I'm trying to change the text color for that specific rollover button, but can't figure out how to refer to the specific dynamic text box.
Help. anyone?
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
showdate = [];
showtime = [];
showlength = [];
showtitle = [];
showurl = [];
episodetitle = [];
episodeurl = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
showdate[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
showtime[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
showlength[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
showtitle[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
showurl[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
episodetitle[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
episodeurl[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
}
mainSchedule();
} else {
content = "file not loaded!";
}
}
bgdbuttons = Array()
bgds = new Array();
bgds.push()
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("info.xml");
function mainSchedule() {
if (loaded == filesize) {
for (var i=0; i<total; i++) {
this["show" + i].mc_time.text = showtime[i];
this["show" + i].mc_show.text = showtitle[i];
this["show" + i].mc_episode.text = "Episode:";
this["show" + i].mc_episodename.text = episodetitle[i];
this["show" + i].mcClick1.index=i;
this["show" + i].mcClick2.index=i;
this["show" + i].mcClick1.onRelease = function() {
getURL(_root.showurl[this.index]);
}
this["show" + i].mcClick1.onRollOver = function() {
_root.show[this.index].mc_show.color = 0x000000;
}
this["show" + i].mcClick2.onRelease = function() {
getURL(_root.episodeurl[this.index]);
}
}
}
}
View Replies !
View Related
Changing Dynamic Text Color? Tweens?
anyone know how? the mc tween doesn't seem to work (colorTo), also tried embedding it in another movie clip, and tween that clip but still no joy? any ideas?
item_mc.main_btn.onRollOver = function(){
trace("coloring");
item_mc.textclip.species_txt.text.color = 0xff0000;
}
also tried...
item_mc.main_btn.onRollOver = function(){
trace("coloring");
item_mc.textclip.species_txt.color = 0xff0000;
}
and the colorTo tweens aswell...
View Replies !
View Related
Changing The Text Color On The List Component
It's my understanding that using listInstance.setStyle( "color", myColor ); should change the colour of the text in my list component, but I'm having a difficult time getting this to work. I've tried a variety of different things where 'myColor' is but nothing seems to be working.
View Replies !
View Related
|