You need to pass the event through the keyDown handler to the field:

on keyDown
  -- put the key
  if the key = RETURN then
    DoIt
  end if
  pass
end

Charlie Fiskeaux II
Interactive Media Developer
Cre8tive Group
cre8tivegroup.com
859/858-9054 x29
cell: 608-9194


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike Warner
> Sent: Friday, April 23, 2004 10:34 AM
> To: [EMAIL PROTECTED]
> Subject: <lingo-l> capture RETURN key problem (D8)
>
> Hello,
>
> haven't used Director in a while (3 years), been in the PHP,
> PERL world.
> Now am building an app where there's an editable one-line
> text field where, when the user hits the enter/return key,
> the attached behavior calls the function DoIt.  I took the
> code right from the Demystified book, but when I use on
> keyDown to check, I can't edit the field, and on keyUp allows
> the RETURN to be "typed".  Can someone less rusty refresh my memory?
>
> Many thanks,
> Mike
>
> Behavior follows:
>
> on keyDown
>   --put the key
>   if the key = RETURN then
>     DoIt
>   end if
> end
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25"
> http://photos.yahoo.com/ph/print_splash
> [To remove yourself from this list, or to change to digest
> mode, go to http://www.penworks.com/lingo-l.cgi  To post
> messages to the list, email [EMAIL PROTECTED]  (Problems,
> email [EMAIL PROTECTED]). Lingo-L is for learning and
> helping with programming Lingo.  Thanks!]



[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to