04-07-05 10:51 PM
Not sure if this will help in any way, but this is the code I use to
submit via enter key (AS1):
//detect enter button press
enterListener = new Object();
enterListener.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
trace(Selection.getFocus());
//function here
}
};
Key.addListener(enterListener);
// Lisa Larson
On Mar 1, 2005, at 6:09 PM, RconR007 wrote:
> Hi List:
>
> I am trying to catch the ENTER key from a textbox so that I can run a
> function to update the chat list.
> Basically the user doesn't want to hit the SEND button on the chat,
> they want to hit the ENTER key.
> I typed the following code on the onSetFocus of the textbox:
>
> message.onSetFocus = function() {
> myReturnKey = new Object();
> myReturnKey.onKeyDown = function(){
> var _$key = key.getCode();
> if(_$key == 13){
> // Perform my function to update the chat history... The
> chat history function then clears the textbox, but I still get a
> RETURN or Carriage Return // that shouldn't happen if I
> am making my textbox = ""; HELP
> }
> }
> key.addListener(myReturnKey);
> }
>
>
> But its producing a weird result. I am getting a RETURN that is
> inserted into the textbox once I update the chat.
> Any suggestions, because this is driving me crazy.
>
> Thank you,
> --
> Life is short, maximize your time,
>
> RconR-007
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|