Solved

Flash htmlText Font Color??

Posted on 2004-10-05
2
568 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

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

919 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