Hi Jean-Marc,
as Klaus said it is a bit risky to fool around with the layer of a grouped control: you can easily "layer it out of the group".
But if you are careful it is ok. Just know what your are doing.
For me this works very well, maybe someone has an easier way.
for testing I made a group from a bunch of overlapping buttons. The buttons don't have any script, especially not a mouseDown handler
put this script into the group
Code: Select all
on mouseDown
set the relayerGroupedControls to true
put empty into tLayers
repeat with i = 1 to the number of controls of me
put the layer of control i of me & comma after tLayers
end repeat
delete last char of tLayers -- a comma
put max (tLayers) into tMaxLayer
set the layer of the target to tMaxLayer
set the relayerGroupedControls to false -- important
end mouseDown
it will bring the button you click to the front.
Kind regards
Bernd