Page 1 of 1
send (pass) a message to objects below
Posted: Sat May 01, 2010 5:46 am
by ninetrees
When I put a text field over a rectangle or a rectangle over a window, I expected that it would be invisible to events if it had no script. It seems to block them though. So I tried adding on mouseDown pass mouseDown end mouseDown to top object. Still no luck. Is there a stack/card/object property to make them event invisible?
Re: send (pass) a message to objects below
Posted: Sat May 01, 2010 10:29 am
by bn
ninetree,
you might want to look at the user guide pp 134 message hierarchy to understand what is happening.
A message like mouseUp that is not "trapped" i.e. there is no script in the control to react to the event will be passed to the card than to the stack etc. until it reaches the engine.
In your case the mouse messages dont go to the control that happen to be placed at the same location as the control in front of it but to the card.
What you can do is to direct the mouse messages to the object that you want to react to mouseUp.
If you have a rectangle graphic that is on top of a button than you could put this into the script of the graphic
Code: Select all
on mouseUp
send mouseUp to button 1
end mouseUp
An exception to what I said is if you set the opaque of the graphic to false in the properties inspector: than the click goes "through" the graphic and reaches the underlying button. But you will only see the border of the graphic, not the fill. If you just want to "frame" something then that is the way to go. The same applies to transparent areas of an image in images that support transparency like png.
regards
Bernd