> God knows why this is such a hassle:
>
> I have a chat app that sends messages when the user hits enter. The
> input field is multiline (and needs to be, for the sake of elegance).
>
> Hitting enter inserts a line break in the text regardless of what i do
> right now. The method reads something like this:
>
> function clearText() {
>       chat_input.text = "";
>       trace(chat_input.text.length);
> }
> kl = {};
> Key.addListener(kl);
> kl.onKeyDown = function() {
>       if (Key.isDown(Key.ENTER)) {
>               clearText();
>       }
> };
>
> After clearText, The input field has 2 blank lines and a text length of
> 0. I'm hugely confused here, and kind of freaked out.

If it's got a text length of 0 maybe it doesn't actually have two blank
lines, it's just not reset its height to where it was before clearing the
text. Try storing its _width and _height and resetting those as part of your
clearText function.

Danny
> http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to