Blundell, Steven Paul <[EMAIL PROTECTED]> wrote:

> How do I make it so that when a user has entered text into a text field and
> they then press enter that the button which activates the next move is run.

Hi Steven,

on keydown(me)
  case the key of
    RETURN, ENTER: me.mValidate()
    otherwise:     pass
  end case
end

> how do I make it compulsory that they enter at least 3 characters in
> the name field?

on mValidate(me)
  tText = sprite(me.spriteNum).member.text
  if tText.char.count < 3 then
    beep
  else
    -- Do what you want to do with tText
  end if
end


Your button can call the mValidate() command as well.  The same rule about
at least three characters will then apply whether the user clicks the button
or presses Enter or Return.

Cheers,

James


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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