Relayering and dragging a group within a group

David Epstein dfepstein at comcast.net
Sun Jun 4 19:03:19 EDT 2006


When the mouse is pressed on a button, I want the group that it is  
part of to come to the front and be draggable to a different  
location.  There are several such groups, and all are parts of a  
higher-level group called "wb."

The group "wb" has the following script:

on mouseDown
   if "button" is in the target then
	
     -- (1) put the group this button belongs to on top of other
     -- groups that are subgroups of group "wb":			
     put the short id of the owner of the target into tgid
     start editing group "wb"
     set the layer of group id tgid to top
     stop editing

     -- (2) move this group with the mouse until the mouse is released:
     grab group id tgid of group "wb"
   end if
end mouseDown

Part (2) does not work (using Metacard 2.5 on Mac OSX 10.4).  If I  
comment out part (1), part (2) works as expected.  Can anyone see an  
error or suggest a remedy?

Many thanks.

David Epstein



More information about the use-livecode mailing list