In AS3 I have to keep applying the TextFormat object to the TextField when it's content changes:

function createText():void {
           _nameText.setSelection(0, _nameText.text.length);
           //_nameText.caretIndex = 0;
           _nameText.setTextFormat(_nameFormat);
           addChild(_nameText);
           _nameText.addEventListener(Event.CHANGE, textChange);
}


private function textChange(evt:Event):void {
           _nameText.setTextFormat(_nameFormat);
}

Andrew Sinning wrote:
I'm creating an input-type TextField at runtime and setting the align prop of its TextFormat to 'center'. The default text displays centered. If the user edits just one character at a time the text remains centered. However, if they select all of the text and then type something in, the align suddenly changes to 'left'. Any idea what's going on?

Thanks!
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01736 759321
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to