A TextFormat 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()
{ tfield1.htmlText += " more text "; tfield2.htmlText += " more text "; }
adrian
Zarate
I'm also having problems with setNewTextFormat and html textfields.
Don't you?
Joseph Balderson
Gaurav
Joseph is very rite. for this purpose you need to use TextField.StyleSheet.
you can find the reference to this class here http://visiblearea.com/visdoc/examples/ActionScript2dot0/mmfl8/TextField.html#styleSheet
Lesley
Here is my code for the input box.
<!--- Matl Description Input Box --->
<cfformgroup type="vbox" style="verticalGap:-5">
<cfformitem type="text" style="fontWeight:bold;">Matl Description:</cfformitem>
<cfinput type="text" name="Material_Description"
value="FORM.Material_Description"
onKeyDown="if(Key.isDown(Key.ENTER)) {submitForm()}">
</cfformgroup>