Page 1 of 1

Layers, groups, and clicking.

Posted: Thu Jan 26, 2012 10:11 am
by kevin11
Hi all,

I have a group of overlayed fields, one field is displaying graphic effects, another is a colour wash, one layer contains text and links, over that another layer with different effects.
The problem I have is that when I click on a text link in one layer, the overlying layer grabs the click, and the link is not being seen by LC as having been clicked. Is there any way I can make a layer transparent to a click and let it through to underlying layers/fields ?

Thanks

Re: Layers, groups, and clicking.

Posted: Thu Jan 26, 2012 2:25 pm
by dunbarx
I just know that there is a simpler, more direct way to do this. I think it was discussed and solved last year or so in either these forums or in the mail list. Some property that makes a control "message transparent"?

But this klunky script ought to work, and be extendable for you, at least until someone comes back with a nicer way.

I made two buttons, B1 and B2. B1 is partially over B2. In the script of B2:

Code: Select all

on mouseUp
   beep 3
end mouseUp
In the script of B1:

Code: Select all

on mouseUp
   get the layer of  the target
   repeat with y = 1 to the number of controls
      if y = it then next repeat -- to prevent runaway recursion
      if the mouseLoc is within the rect of control y then send "mouseup" to control y
   end repeat
end mouseUp
If you click on the portion of B2 that is exposed, you get three beeps. If you click on the common area, you get three beeps, If you click on the area of B1 that does not overlie B2, you get nothing.

Craig Newman

Re: Layers, groups, and clicking.

Posted: Thu Jan 26, 2012 4:36 pm
by kdjanz
I believe if you lock the overlay fields they will ignore the clicks. Leave your real field unlocked so that it still works.

Hope this helps

Kelly

Re: Layers, groups, and clicking.

Posted: Thu Jan 26, 2012 4:50 pm
by Klaus
Hi folks,

all visible objects will receive mouse events, locked or not!


Best

Klaus

Re: Layers, groups, and clicking.

Posted: Sun Jan 29, 2012 11:13 am
by kevin11
kdjanzGAFp8Q wrote:I believe if you lock the overlay fields they will ignore the clicks. Leave your real field unlocked so that it still works.

Hope this helps

Kelly
Thanks, but if you do this, the layer with text and links then becomes editable, and a click on a link is no longer a click on a link.