no danny. setNewTextFormat means that all NEW text in the textfield
will be formed. setTextFormat is only once and not for new text. and
if you do some new text via AS setNexTextFormat will work fine..

giles. if i understand you right youll get html-strings from your xml.
some of them have a font-tag, some not.
 so make a searchFunction which is used for each textString from xml.
if the search will not find '<font face=" you have to rewrite your
string

eg

searchFontTag=function(str){
 if(str.indexOf("<font face=")==-1){
     var s="<font face='arial'>"+str+"</font>"
     return s
 }
return
}

but, other question....why is your xml inconsistent like it seems?!

olee




2007/6/12, Danny Kodicek <[EMAIL PROTECTED]>:

> Hi All
>
> I have a loop that creates pages, creates textfields then
> adds text. Some of this text has font tags and some doesn't.
> I want to use a default textFormat so that an embedded font
> is used when no <font is specified in the text:
>
>             currentPage.createTextField("my_txt", 1, 5, 5,
> currentPage._width - 10, currentPage._height - 10);
>             currentPage.my_txt.autoSize = false;
>             currentPage.my_txt.multiline = true;
>             currentPage.my_txt.wordWrap = true;
>             currentPage.my_txt.selectable = false;
>             currentPage.my_txt.embedFonts = true;
>             currentPage.my_txt.html = true;
>
>             var my_fmt:TextFormat = new TextFormat();
>             my_fmt.font = "Arial";
>             currentPage.my_txt.setNewTextFormat (my_fmt);
>
>             currentPage.my_txt.htmlText = this.Model.pages[i].text;
>
> This works fine for text that has Arial specified in a font
> tag but for all the other pages which are just text no text
> appears (when tracing I see that Times is used which is not embedded).
>
> Why isn't this working? The setNewTextformat should change
> the default textformat for the field from then on? I am still
> getting Times though.

setNewTextFormat is, in my opinion, broken: it works for text entered by a
user but not for text entered through ActionScript. You need to run
setTextFormat manually after changing it.

Danny

_______________________________________________
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



--
http://www.renkster.de/#/about/
_______________________________________________
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