A TextFormat bug?
5 comments Posted by: Nahuel I wonder if this is a bug.This is the scenario: you have a TextField to which you have applied a TextFormat. Then you try to add some text to the TextField. There are two possible outcomes of doing that: if it is an HTML TextField, the formatting is preserved after inserting the additional text, as you would expect. But if it is a non-HTML TextField, all formatting is lost when the text is added.
An example of this:
This is the code:
t = "this is a long text bla bla bla bla bla"; tfield1.html = true; tfield1.border = true; tfield1.htmlText = t; tfield2.html = false; tfield2.border = true; tfield2.text = t; var tformat = new TextFormat(); tformat.bold = true; tformat.italic = true; tfield1.setTextFormat( 4 ,15, tformat ); tfield2.setTextFormat( 4 ,15, tformat ); but.onRelease = function()Category: Flash |
{ tfield1.htmlText += " more text "; tfield2.htmlText += " more text "; }