The below script works in terms of properly selecting and moving the buttons to where they should be, but i would like all of the moves to be done at the same time.
I tried using "lock moves" but each button still moves individually when the handler is called.
Code: Select all
on moveAtom
put "p16,p17,p18,p1,p2,p3,p4" into tRow1
put "p15,p29,p30,p19,p20,p21,p5" into tRow2
lock moves
--take each "pair" of cells from above for comparison
repeat with xx=1 to 7
put item xx of tRow1 into tDestiny
put item xx of tRow2 into tStarting
--if there's a value in B, but nothing in A, then move B to A
if gHex[tStarting]["atom"] is not empty and gHex[tDestiny]["atom"] is empty then
put gHex[tStarting]["atom"] into gHex[tDestiny]["atom"]
put gHex[tStarting]["value"] into gHex[tDestiny]["value"]
put empty into gHex[tStarting]["atom"]
put 0 into gHex[tStarting]["value"]
put gHex[tDestiny]["atom"] into tAtom
put top of graphic tDestiny+24 into tTop
put left of graphic tDestiny+24 into tLeft
move button tAtom to tLeft,tTop
end if
end repeat
unlock moves
end moveAtom