all groups > flash actionscript > july 2007 >
You're in the

flash actionscript

group:

Dynamic text / input text formatting font color


Dynamic text / input text formatting font color aaronlyon
7/9/2007 10:09:15 PM
flash actionscript:
I have a single variable called firstname, and two text fields on the screen,
one dynamic text at the top right to display the user's name in a small grey
font, and one larger input text field in the middle of the screen. Both have
the variable parameter set to firstname, but each field is formatted
differently (i.e., color, font size, alignment).

When I type text into the larger field, the font size/color/alignment suddenly
changes in the smaller field. How do I preserve the formatting, but update only
the variable?
Re: Dynamic text / input text formatting font color kglad
7/9/2007 11:22:36 PM
Re: Dynamic text / input text formatting font color aaronlyon
7/9/2007 11:32:21 PM
Yes. Try this simple experiment: create two Input Text fields both with the
same variable name. Format them differently. Now see what happens when you
publish and run. How do you get the formatting to be independent for each field?
Re: Dynamic text / input text formatting font color aaronlyon
7/9/2007 11:34:23 PM
Re: Dynamic text / input text formatting font color kglad
7/9/2007 11:36:10 PM
i see no problem. i used different fonts, font color, font size and alignment
with the same textfield variable in one input textfield and one dynamic
textfield. also, no problem with 2 input textfields.
Re: Dynamic text / input text formatting font color kglad
7/10/2007 3:03:18 AM
the problem is caused because you have html-enabled textfields. disable html
and you should see no problem.

if you must have html-enabled textfields give them different instance names of
use the onChanged method of textfields to have each textfield update the
htmlText property of the other.
Re: Dynamic text / input text formatting font color aaronlyon
7/10/2007 3:32:14 AM
I see the HTML toggle switch on the Properties, but it makes no difference. I also tried this:

_root.textfield.html = false;

Re: Dynamic text / input text formatting font color kglad
7/10/2007 4:40:02 AM
Re: Dynamic text / input text formatting font color aaronlyon
7/10/2007 4:15:31 PM
Auto kern was not checked.

I could not figure out how to get Flash to stop copying text formatting along
with the text, but I found a simple workaround.

Do not give the text fields variable names. Give them instance names instead,
and execute this command when you want to update the value of one with the
content of the other:

myTextField1.text = myTextField2.text;

That copies ONLY the text, not the formatting.

AddThis Social Bookmark Button