Drop Targets ???

Klaus Major k_major at os.surf2000.de
Tue Mar 4 12:59:01 EST 2003

Hi Richmond,

> Drop Targets
> Suppose I have 2 trashcans: 1 labelled “Minerals’ and the
> other labelled “vegetables”
> (let them be jpegs) and a number of other jpegs: carrot,
> apple, diamond, sandstone, cabbage.  I want users to drag
> the jpegs to the relevant trashcans and the jpegs to either:
> stick to the cans
> or
> disappear if the trashcan is the correct one, else pop back
> to its original position
> I’ve done this with Director (lovely but expensive) and
> Toolbook (Yuck) - and would love to do it with RunRev
> .................
> Richmond Mathewson

no problem, i have done this before and i am still alive and well :-)

Give this script to the things that are supposed to be dropped on the 

on mousedown
   grab me
   ## yes, the easy way, why not :-)
end mousedown

on mouseUp
   if within(img "the correct trashcan", the mouseloc) then
        hide me
        ## or do whatever you want in this case
     set the loc of me to x,y
     ## replace x,y with the original loc of this object
   end if
end mouseUp

Hope that helps...


Klaus Major
k_major at os.surf2000.de

Is the CD-ROM still coming?
Or will i have to wait for christmas? ;-)

More information about the use-livecode mailing list