Try this:

-- button 1
property pMyloc

on mouseDown me
  pMyloc = the mouseLoc
end

on mouseUp me

  if the mouseLoc <> pMyloc then
    beep
  else
    put "BUTTON 1"
  end if
end


-- button 2
property pMyloc

on mouseDown me
  pMyloc = the mouseLoc
end

on mouseUp me

  if the mouseLoc <> pMyloc then
    beep
  else
    put "BUTTON 2    "
  end if
end


It is of the top of my head but maybe it helps you on the way

Nikaj Wiggers


if you came up with a better one please let me know


-- Live to learn




neil wrote:

> I have come across something I find extremely annoying. I have buttons on
> the stage. When I click on one of them and drag over top of another one and
> then release the mouse button the behavior on the button I am now currently
> over gets executed. WHY?
>
> Try these on 2 buttons to see what I mean.
>
> Button 1
> on mouseUp me
>    alert "I'm button 1"
> end
>
> Button 2
> on mouseUp me
>    alert "I'm button 2"
> end
>
> Now click on the sprite that has the button 1 behavior on it. Keep the
> mouse down and drag over top the sprite with button 2 on it. Release the
> mouse button. You shouldn't see anything but I think you are seeing
> "I'm button 2" (that's what I get)
> You can do the same by clicking on sprite 2 and releasing over sprite 1.
> I get "I'm button 1"
> I have tried setting a flag in the behavior but it doesn't seem to make a
> difference.
> ie. (I have a flag in place for these tests)
> Sprite 1 is clicked -- drag to sprite 2 -- release -- NO ALERT
> Sprite 2 is clicked -- drag to sprite 1 -- release -- ALERT "I'm button 1"
> Sprite 1 is clicked -- drag to sprite 2 -- release -- ALERT "I'm button 2"
> and back and forth from there.
> Any suggestions?
>
> Later.
> ...Neil
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
> email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to