Page 1 of 1

Drag&Drop of Pictures

Posted: Mon Mar 12, 2012 12:47 am
by Tomka
Hi,

I need little help. In my test-stack (see attachment) is a green bubble which is dragable. I need a way to see if its dropped into one of the three places on the right group.

But dragEnter dont work for that. If I drag the green bubble over the right group it doesnt beep. What my mistake?

Thanks alot

Re: Drag&Drop of Pictures

Posted: Mon Mar 12, 2012 1:47 pm
by Mark
Hi,

If your picture stays within a window, then you don't need to to mess with drag actions. Just use a repeat loop. In its simplest form:

Code: Select all

on mouseDown
  repeat while the mouse is down with messages
    set the loc of me to the mouseLoc
    wait 0 millisecs with messages
  end repeat
  if the loc of me is within the rect of "Some Group" then
    // do something
  else if the loc of ms is wtihin the rect of "Other Group" then
    // do something else
  end if
end mouseDown
Kind regards,

Mark

Re: Drag&Drop of Pictures

Posted: Mon Mar 12, 2012 2:11 pm
by Tomka
Thanks Mark. Sounds really good, I´ll check it out :)

Update´ll come soon.

Re: Drag&Drop of Pictures

Posted: Mon Mar 12, 2012 3:02 pm
by Tomka
Hi,

I see one little problem for my project in this script. Is it possible to dont use any groupnames in the script? The user can creat new groups which will be cloned. So it can happen that there are 20 or more groups with different names.

Re: Drag&Drop of Pictures

Posted: Mon Mar 12, 2012 3:10 pm
by Mark
Hi,

Of course, you can add as many groups as you like. Just extend the script.

Mark