Some of the text that is being pulled in from xml will have font tags
attached and some won't so I want to se thte default format.
I have got round it for now with an if statement so the default format is
only set if there is no font tag in the string.
However in the case of a string with only part of the text surrounded by a
font tag the rest of the string will still default to the times font which
won't appear.
On 6/12/07, o renken <[EMAIL PROTECTED]> wrote:
hey
one question...why are you mixing html and TextFormat? i try to use one of
both.
where did you get the font for each textField from?
so you could do it on that way
var default_font="arial"
var html_font=""
if(text_html_font==undefined){
html_font=default_font
}
currentPage.my_txt.htmlText ="<font face='"+html_font+"'>"
this.Model.pages[i].text+"</font>";
greets
olee
2007/6/12, Giles Roadnight <[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.
>
> Many Thanks.
> _______________________________________________
> [email protected]
> 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/
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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