Re: [Flashcoders] Bold and italic charater options with html text

2006-03-01 Thread bryan.rice


On Mar 1, 2006, at 11:48 AM, James Deakin wrote:


What is the best course of action/
best practice in this situation?



Look into using CSS to specify the font-family:

p
 {
font-family: Helvetica 55 Roman;
display: inline;
}

or look into using the font tag:



When you are using htmlText and embedding fonts, you have to specify  
the font one way or another in html.


blue skies,
bryan
___
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


[Flashcoders] Bold and italic charater options with html text

2006-03-01 Thread James Deakin
Hi List,

I have posted this a few times. Am i asking a question which has already
been covered or can i get this info else where. I have read the manual and
consulted my mook books but am none the wiser. Please help!

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, 0x33, true, false,
false, null, null, "center");
theBold = new TextFormat("75 Helvetica Bold", 15, 0x33, true, false,
false, null, null, "center");
theItalic = new TextFormat("Helvetica 56 Italic", 15, 0x33, 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, 15 February 2006,";
txtMain.htmlText += "23:48 GMT E-mail 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