So I thought I'd try a different tack to see if I could solve it a different way (as well as using code closer to my learning level at the moment): I found some code for moving any button in two rows within a rectangular area; so the limits are fine, no probs there.
If I drag a button and it overlaps (intersects) another button, in a mouseUp handler I'd like to get the name of the button which is intersected. That way I can get the loc of the button and swap it with the button intersecting it:
Code: Select all
local PosOldA, PosOldB, PosNewA, PosNewB, tNameB
on mouseDown
put item 1 of the loc of me into PosOldA
put item 2 of the loc of me into PosOldB
end mouseDown
on mouseUp
------- here's the pseudocode I'd like to replace with real code:
put the name of the intersected button into tNameB
------------------------------------------------------------
put item 1 of the loc of button tNameB into PosNewA
put item 2 of the loc of button tNameB into PosNewB
set the loc of me to PosNewA,PosNewB
set the loc of button tNameB to PosOldA,PosOldB
end mouseUp
