Hi Guys,

I'm having a few issues with html formatted text-fields.

I have embedded the following fonts in the library and given them linkage names Helvetica 55 Roman, 75 Helvetica Bold, Helvetica 56 Italic. Then I am using the code below to try to dynamically produce a textfield which can be populated with text marked up with simple html tags ( in the real application the text will come from an XML file containing said text). My client wishes to use html as their copy writers know how to use it.

My problem is this the tags are ignored. What is the best course of action/ best practice in this situation? I was thinking of creating a function to assign a bold textformat (theBold) to the characters in the textfield. I could get the index of the text using pattern matching in the string but that just seems a bit like over kill isn't there a better way?

theRoman = new TextFormat("Helvetica 55 Roman", 15, 0x333333, true, false, false, null, null, "center"); theBold = new TextFormat("75 Helvetica Bold", 15, 0x333333, true, false, false, null, null, "center"); theItalic = new TextFormat("Helvetica 56 Italic", 15, 0x333333, true, false, false, null, null, "center");
// create a text feild
this.createTextField('txtMain', 0, 10, 10, 300, 300);
//
txtMain.html = true;
txtMain.background = true;
txtMain.backgroundColor = 0xFF6600;
txtMain.wordWrap = true;
txtMain.embedFonts = true;
txtMain.setNewTextFormat(theRoman);
txtMain.htmlText = " Last Updated: Wednesday, <b>15 February 2006</b>,";
txtMain.htmlText += "23:48 GMT <i>E-mail</i> this to a friend Printable version US attacks Iraq abuse images leak";
// set another text format
txtMain.setTextFormat(0, 6, theBold);
txtMain.setTextFormat(6, 15, theItalic);

James Deakin
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to