the grabbedObject?

Richmond Mathewson geradamas at yahoo.com
Mon Dec 22 10:11:36 EST 2008


I started with some 'goofy' experiments:

1. this script was in the object to be grabbed

on mouseDown
  grab me
  set the textColor of me to "yellow"
  set the backGroundColor of me to "black"
end mouseDown

on mouseUp
  set the textColor of me to "black"
  set the backGroundColor of me to "pink"
end mouseUp

interestingly enough the 'set the backGroundColor of me to "black"'
didn't work because the background went blue, i.e. the opposite of
the yellow text (??????).

moving right along to the coloured fields:

2. 

on mouseDown
  grab me
end mouseDown

on mouseMove 
    on mouseMove 
    if within (fld "fGREEN", the mouseloc) then 
    set the textColor of me to "yellow"
  else
    if within (fld "fWHITE", the mouseloc) then 
    set the textColor of me to "black"
  else
    set the backColor of me to empty
  end if
  end if
end mouseMove

 worked a charm!

Have a look at "Grabbed Object.rev" at revOnline under 'Richmond'.

AND, as it works, what exactly is your objection to 'loc' ?

By using mouseMove one avoids having to wait for mouseUp; so the
button changes in mid-drag, so to speak.

sincerely, Richmond Mathewson.


____________________________________________________________

A Thorn in the flesh is better than a failed Systems Development Life Cycle.
____________________________________________________________


      



More information about the use-livecode mailing list