Yuu
June 11th, 2008, 05:44 PM
I've got a textfield that is populated with content from XML. In some of the copy I was given, a & is used. Once that copy makes it through the ActionScript it comes out as & -Just like one would use in HTML
I've tried all the suggestions on this page
http://www.kirupa.com/web/xml/XMLspecificIssues8.htm
System.useCodepage = true; - got me an error
Unicode escape characters just showed as text, so you'd see \u0026
Here's the code that creates the text field. If you need to see more - like how the XML is passed just let me know. Hope someone knows more than I do on this one.
Thanks in advance.
var body:TextField = new TextField();
body.text = " ";
//Position the text field
body.x = 0;
body.y = 0;
var gothamLight:Font = new _GothamLight();
// Formatting for the Body Field
var bodyText:TextFormat = new TextFormat();
bodyText.font = gothamLight.fontName;
bodyText.color = 0xFFFFFF;
bodyText.size = 10;
bodyText.leading =4;
//// Apply the formatting to the fields
//Field Properties for text Field "body"
body.embedFonts = true;
body.defaultTextFormat = bodyText;
body.width = 340;
body.autoSize = TextFieldAutoSize.LEFT;
body.multiline
body.wordWrap = true;
body.border = false;
body.borderColor = 0xFFFFFF;
body.selectable = false;
body.antiAliasType = AntiAliasType.ADVANCED;
/////
// Add the field named "body" to the stage
this.addChild(body);
I've tried all the suggestions on this page
http://www.kirupa.com/web/xml/XMLspecificIssues8.htm
System.useCodepage = true; - got me an error
Unicode escape characters just showed as text, so you'd see \u0026
Here's the code that creates the text field. If you need to see more - like how the XML is passed just let me know. Hope someone knows more than I do on this one.
Thanks in advance.
var body:TextField = new TextField();
body.text = " ";
//Position the text field
body.x = 0;
body.y = 0;
var gothamLight:Font = new _GothamLight();
// Formatting for the Body Field
var bodyText:TextFormat = new TextFormat();
bodyText.font = gothamLight.fontName;
bodyText.color = 0xFFFFFF;
bodyText.size = 10;
bodyText.leading =4;
//// Apply the formatting to the fields
//Field Properties for text Field "body"
body.embedFonts = true;
body.defaultTextFormat = bodyText;
body.width = 340;
body.autoSize = TextFieldAutoSize.LEFT;
body.multiline
body.wordWrap = true;
body.border = false;
body.borderColor = 0xFFFFFF;
body.selectable = false;
body.antiAliasType = AntiAliasType.ADVANCED;
/////
// Add the field named "body" to the stage
this.addChild(body);