Solved

Flash htmlText Font Color??

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.

856 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