Forgot to tell you that myTextBox is the name of the text box instance (not the var)
also you have to clcik on "Render text as HTML" icon in the text box properties.
Main Topics
Browse All TopicsI am using Flash 8 and I am building a flash stock ticker. I want to change the color of the text based on change of the stock (positive or negative). I have created a text file using aspx and I am loading the variables from that file (here's the sample output):
sym_0=ABP&trade_0=4.24&sig
I created a variable (sign_*) that denotes the change (0 = negative change, 1 = positive change).
Here's the code I have on my actions line of the movie, frame 1:
myData = new LoadVars();
myData.onLoad = function(){
quote__0 = this.sym_0 + ": $" + this.trade_0 + ", " + this.change_0 + ", " + this.percent_0 + "% ";
quote__1 = this.sym_1 + ": $" + this.trade_1 + ", " + this.change_1 + ", " + this.percent_1 + "% ";
quote__2 = this.sym_2 + ": $" + this.trade_2 + ", " + this.change_2 + ", " + this.percent_2 + "% ";
quote__3 = this.sym_3 + ": $" + this.trade_3 + ", " + this.change_3 + ", " + this.percent_3 + "% ";
format = new TextFormat();
format.color = 0x00FF00;
if (this.sign_0 == 1) {
tQuote_0.setTextFormat(for
};
if (this.sign_1 == 1) {
tQuote_1.setTextFormat(for
};
if (this.sign_2 == 1) {
tQuote_2.setTextFormat(for
};
if (Number(this.sign_3) == 1) {
tQuote_3.setTextFormat(for
};
};
myData.load("../stocks.txt
All of the dynamic text boxes individual graphics, instances are given for each text box).
Everything works except changing the color of the font.
HELP!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
It should depend on your textfile variables....
sign_1=1 means first textfield (tQuote_0) color will change
sign_2=1 means 2nd textfield (tQuote_1) color will also change
similarly for 3rd and 4th,
sign_3=1 and sign_4=1 will change the color of tQuote_2 and tQuote_3 textfields..
if still unable to fix it.. please upload your source file I will fix it for you
Rgds
Aneesh
Hi
I've made you a flash file where everything is working fine, you can download it from:
www.pylon-group.com/tmp
Regard,
Ramy
Business Accounts
Answer for Membership
by: Ramy_atefPosted on 2006-05-22 at 09:53:55ID: 16735867
Hi
You can use the HTML tag (font) in the dynamic text box
for example
myTextBox.htmlText = "<font color='#FF0000'>This is red text</font><font color='#0000FF'> This is blue text</font>";
that will display the text in different colors