Page 1 of 1

Moving objects with mouse (SOLVED)

Posted: Thu May 08, 2014 4:39 pm
by MaxV
Hi all,
I feel clumsy because I want to move an image with the mouse, draging it, but my code seems to me too complicated. I wrote in image code:

Code: Select all

global mytest

on mousedown
   put true into mytest
end mousedown

on mouseUp
   put false into mytest
end mouseUp

on mousemove
   if mytest then
      set the loc of me to the mouseloc
   end if   
end mousemove
Is there a best and more concise way to do it? :?:

Re: Moving objects with mouse (SOLVED)

Posted: Thu May 08, 2014 4:44 pm
by MaxV
Founded the solution:

Code: Select all

on mousedown
   grab me
end mousedown