View Single Post
07-23-2008, 05:31 AM
#4
Petertang is offline Petertang
Petertang's Avatar
Status: Junior Member
Join date: Sep 2007
Location: Singapore
Expertise:
Software:
 
Posts: 51
iTrader: 0 / 0%
 

Petertang is on a distinguished road

Send a message via Yahoo to Petertang

  Old

I reliased that to apply masking to a dynamic text field, it needed to embed the font to the flash. But some of the html tag could not work for the html text field such as <br>,<b> and <strong>. I tried using the \n to replace the <br> tag in order to move the text to the next line and it work on \n. i also tried to using the stylesheet.

Do anyone know what the mistake i made? Below is the script and the style sheet i wrote:

ActionScripting:
-----------------------------------------------------------------
var styleObj:TextField.StyleSheet = new TextField.StyleSheet();

var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "WalkwayBlack";

var my_fmt1:TextFormat = new TextFormat();
my_fmt1.font = "Whimzee";

txt.embedFonts = true;
txt.autoSize = true;
txt.html = true;
txt.styleSheet = styleObj;
txt.htmlText = "<u>testing</u> <br><span class='headline'>testing</span>\ntesting";
txt.setTextFormat(my_fmt);

txt1.embedFonts = true;
txt1.html = true;
txt1.htmlText = '<u>testing</u> <b>testing</b> testing';
txt1.setTextFormat(my_fmt1);

styleObj.load("styletest.css");

maskobj_mc.setMask(txt);
----------------------------------------------------------------

CSS Style Sheet: styletest.css
-----------------------------------------------------------------
.bold {
font-weight: bold;
}
.headline {
color: #333333;
font-size:26px;
font-weight:bold;

}
-------------------------------------------------------------------