And if you want to do it outside a mouseDown, then replace mouseDown
with mouseEnter...

local lCurrentPieceDragged

on mouseEnter
   if the short name of the target contains"puzzlePiece" then
      put the target into lCurrentPieceDragged
   end if
   if lCurrentPieceDragged  is not empty and the short name of the
target contains "finalPosition"
      put the cMyPuzzlePiece of the target into tMyPuzzleName
      if tMyPuzzleName = lCurrentPieceDragged then
         put empty into lCurrentPieceDragged
         fitPuzzlePiece lCurrentPieceDragged
      end if
   end if
end mouseEnter

on fitPuzzlePiece pTarget
   --> STORE THE 'FIT' LOC AS A CUSTOM PROP
   --> OF THE PUZZLE PIECE
   put the cFinalLoc of pTarget into tLoc
   set the loc of pTarget to tLoc
end fitPuzzlePiece

on mouseMove x,y
   if lCurrentPieceDragged is not empty then
      set the loc of lCurrentPieceDragged to x,y
   end if
end mouseMove

** NOTE THIS IS ALL FROM MEMORY AND HAS NOT BEEN TESTED
   BUT THE STRATEGY SHOULD BE SOLID
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to