Page 1 of 1

Yet another button question

Posted: Wed Aug 27, 2008 12:27 pm
by Srdjan
Hi there

I would like to handle all MouseEnter & MouseDown messages of card's buttons in one place. What I am trying to do is the following:

on mouseEnter
if button where mouseEnter event occured is "buton1" then...
end mouseEnter

is there function (or property) for that? I can't find it...

Regards

Posted: Wed Aug 27, 2008 12:40 pm
by Klaus
Hi Srdjan,

you can use "the target" (see the docs) like this in your cardscript (same for mousedown etc...):

Code: Select all

on mouseenter
  ## Only "react" on buttons:
  if word 1 of the target <> "button" then
    exit mouseenter
  end if
  
  ## Handle only THIS special button:
  if the short name of the target = "button1" then
    ## do your stuff...
  end if
end mouseenter
Hope that helps.


Best from germany

Klaus

Posted: Wed Aug 27, 2008 1:02 pm
by Srdjan
Ho, ho - it works!
Thank you very much for your help.

:D

Posted: Wed Aug 27, 2008 1:40 pm
by Klaus
Srdjan wrote:Ho, ho - it works!
Thank you very much for your help.

:D
ALL the code that I post here works, mortal disbeliever! :D