Page 1 of 1

click through

Posted: Thu Jun 07, 2012 12:53 am
by adventuresofgreg
easy question - just can't figure it out. How do I 'click through' an object? have a background with a mouseup script, and there are some fields and other images and graphics that I would like to pass the mousedown through to the background image. ??

thanks
Greg

Re: click through

Posted: Thu Jun 07, 2012 1:49 am
by shaosean
I would give Fourth World's Extending the LiveCode Message Path a good read over as it will explain how the message path works and how the messages (ie mouseUp) fall through objects..

But it sounds like you want a mouseUp message from a button to be sent to an image.. You can either code all your objects to have this script:

Code: Select all

on mouseUp
  send "mouseUp" to image "YOUR_IMAGE" in 0 milliseconds  -- the 0 milliseconds causes the sent mouseUp to be run after this handler completes
  #pass mouseUp  -- if you want the mouseUp message to continue along the path, uncomment this line
end mouseUp
or, you can add something like this to your card script

Code: Select all

on mouseUp
  if (word 1 of the target = "card") then
    -- user clicked the card
  else
    -- user clicked an object so do what you need to do based on the object
    send "mouseUp" to image "YOUR_IMAGE" in 0 milliseconds  -- the 0 milliseconds causes the sent mouseUp to be run after this handler completes
  end if
  #pass mouseUp  -- if you want the mouseUp message to continue along the path, uncomment this line
end mouseUp