Solved

Flash htmlText Font Color??

Posted on 2004-10-05
2
569 Views
Last Modified: 2013-12-03
Trying to figure out how to make some text a different color?  Can I override broadcastSubtitleFormat.color = 0xffffff; by setting <font color='#FFBE3C'> in broadcastSubtitle_txt.htmlText  for one word?  Any other suggestions are appreciated.  TIA.

if (_global.broadcastSubtitle_array[titleNo] != undefined) {
            createTextField("broadcastSubtitle_txt", 790, 15, 180, 175, 60);
            broadcastSubtitle_txt.multiline = true;
            broadcastSubtitle_txt.wordWrap = true;
            broadcastSubtitle_txt.border = false;
            broadcastSubtitle_txt.selectable = false;
            broadcastSubtitle_txt.html = true;
            //broadcastSubtitle_txt.embedFonts = true;
            broadcastSubtitle_txt.htmlText = _global.broadcastSubtitle_array[titleNo]+" <font color='#FFBE3C'><a href = 'http://www.yahoo.com'>More</a></font>";
            broadcastSubtitleFormat = new TextFormat();
            broadcastSubtitleFormat.font = "Arial";
            //broadcastSubtitleFormat.bold = true;
            broadcastSubtitleFormat.color = 0xffffff;
            broadcastSubtitleFormat.size = 10;
            broadcastSubtitle_txt.setTextFormat(broadcastSubtitleFormat);
      }
0
Comment
Question by:splendorx
2 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 125 total points
ID: 12235582
Actually I would do it in two ways (of choice):

1.

createTextField("broadcastSubtitle_txt", 790, 15, 180, 175, 60);
broadcastSubtitle_txt.multiline = true;
broadcastSubtitle_txt.wordWrap = true;
broadcastSubtitle_txt.border = false;
broadcastSubtitle_txt.selectable = false;
broadcastSubtitle_txt.html = true;
//broadcastSubtitle_txt.embedFonts = true;
broadcastSubtitle_txt.htmlText = "<font face='Arial' size='10' color='#FFFFFF'>" + _global.broadcastSubtitle_array[titleNo] + " <font color='#FFBE3C'><a href = 'http://www.yahoo.com'>More</a></font></font>";


2.

createTextField("broadcastSubtitle_txt", 790, 15, 180, 175, 60);
broadcastSubtitle_txt.multiline = true;
broadcastSubtitle_txt.wordWrap = true;
broadcastSubtitle_txt.border = false;
broadcastSubtitle_txt.selectable = false;
broadcastSubtitle_txt.html = true;
//broadcastSubtitle_txt.embedFonts = true;
broadcastSubtitle_txt.text = _global.broadcastSubtitle_array[titleNo] + " More";
broadcastSubtitleFormat = new TextFormat();
broadcastSubtitleFormat.font = "Arial";
//broadcastSubtitleFormat.bold = true;
broadcastSubtitleFormat.color = 0xffffff;
broadcastSubtitleFormat.size = 10;
broadcastSubtitle_txt.setTextFormat(broadcastSubtitleFormat);
overrided = new TextFormat();
overrided.color = 0xfFFBE3C;
overrided.url = "http://www.yahoo.com/";
overrided.target = "_blank";
var ini = broadcastSubtitle_txt.text.indexOf("More");
var end = ini + "More".length;
broadcastSubtitle_txt.setTextFormat(ini, end, overrided)
0
 
LVL 1

Author Comment

by:splendorx
ID: 12238041
Thank you.  It works great!!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i learn adobe flex step by step 4 108
How to delete a TTF (font) file in Windows 7 2 127
Facebook font changes 6 94
How are Button Fonts Created? 2 21
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,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

786 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