Hello Everyone,
I tried finding a solution on the boards but had no success. I am creating a text field using AS and embedding the font; which works perfect. But when I go to import text from xml it does not work if the font is embedded.
Here is the AS code.
PHP Code:
// Create Text Field
this.createTextField("tLabel", this.getNextHighestDepth(), 200, 100, 200, 100);
tLabel.html = true;
tLabel.embedFonts = true;
//tLabel.htmlText = "hello";
//load XML
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(ok){
tLabel.htmlText = this.lastChild.lastChild.lastChild.nodeValue;
}
myXML.load("info.xml");
//Text Format
var tfFormatter:TextFormat = new TextFormat();
tfFormatter.font = "Arial";
tLabel.setTextFormat(tfFormatter);
here is the XML code
PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<text>
<mytext><![CDATA[Some text here<br><font color="#999999">hello1.</font>]]></mytext>
<mytext><![CDATA[Some text here<br><font color="#999999">hello2.</font>]]></mytext>
<mytext><![CDATA[Some text here<br><font color="#999999">hello3.</font>]]></mytext>
</text>
The font is in the library. Any ideas????
Did you also export the font? Linkage - Export for Actionscript
// Create Text Field this.createTextField("tLabel", this.getNextHighestDepth(), 200, 100, 200, 100); tLabel.html = true; //load XML myXML = new XML(); myXML.ignoreWhite = true; myXML.onLoad = function(ok){ tLabel.htmlText = this.lastChild.lastChild.lastChild.nodeValue; tLabel.setTextFormat(tfFormatter); } myXML.load("info.xml"); //Text Format var tfFormatter:TextFormat = new TextFormat(); tfFormatter.font = "Arial";