AS3 TLF text bolding as html

850 views Asked by At

I am having a problem with TLF text in flash.

So I'm reading a .csv file. In it I have "Some text<br><b>some bold text</b><br>bla bla"

I read this in and output it to a textbox that is set to standard Arial.

The <br> tags work fine but the <b> tags do NOT... Any suggestions?

function loadText(fileToLoad:String):void
{
    csvLoader = new URLLoader();
    csvLoader.dataFormat = URLLoaderDataFormat.TEXT;
    csvLoader.load(new URLRequest("TextFiles/" + fileToLoad + ".csv"));
    csvLoader.addEventListener(Event.COMPLETE,CSVLoaded);
}

function CSVLoaded(e:Event):void 
{
    var str:String = csvLoader.data as String;
    var arr:Array = str.split("\n");
    for (var i:int=0; i<arr.length; i++) 
    {
        arr[i] = arr[i].split(';');
    }
    ExtraInfo.Heading.htmlText = arr[0][0];
    ExtraInfo.MainText.htmlText = arr[0][1];
}
1

There are 1 answers

0
Arafat On

I tried with just <b></b> tags... didn't work for me either.

Then it turns out to be Font embedding issue.

Since you are using Arial, you can set the anti-alias property of the TLF textfield to use device fonts.

But it's always better to embed the fonts...