Solved

Flash htmlText Font Color??

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Google Fonts Logo Design 2 106
Outlook 2007-2013 Font size To, CC, Subject 4 315
Removing Flash from Website 6 38
Actionscript in Flash 3 25
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

757 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

20 Experts available now in Live!

Get 1:1 Help Now