Use the defaultTextFormat property instead of setTextFormat. On 1/29/08, Andrew Sinning <[EMAIL PROTECTED]> wrote: > Yes, that's exactly what I'm going ot have to do. This has got to be a > BUG. If I trace out the format.align property after a single character > change it goes from center to null! Then after the user replaces all of > the text it changes to left. > > Glen Pike wrote: > > 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 > >> > >> > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >
-- Cory Petosky : Lead Developer : PUNY 1618 Central Ave NE Suite 130 Minneapolis, MN 55413 Office: 612.216.3924 Mobile: 240.422.9652 Fax: 612.605.9216 http://www.punyentertainment.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders