Page 1 of 1

on mouseenter irregular shape

Posted: Tue Jul 21, 2009 10:03 pm
by howeyb
How do I track when the mouse enters and leaves an irregular shaped area on a picture? If I create an irregular shaped graphic to outline the area in question, the mouseenter and mouseleave handlers use the rectangular shaped bounding box instead of the edge of the graphic within the box.Thanks

Posted: Wed Jul 22, 2009 9:41 am
by BvG
you probably want to use the within function. for example:

Code: Select all

on mouseMove theX,theY
  if within(the long id of me,(theX, theY)) then
    --your code here
  end if
end mouseMove
note that there's a difference in how the "within" function and the "is within" operator work, making the "is within" operator unsuitable for your cause.

on mouseenter irregular shape

Posted: Wed Jul 22, 2009 10:56 am
by jmburnod
Yes, but i watch a 2 pixels margin for diagonals

You can see this msg

http://forums.runrev.com/phpBB2/viewtopic.php?t=3228


Jean-Marc

Posted: Wed Jul 22, 2009 2:02 pm
by howeyb
Thanks for your help...I got it now...after paying a bit, I also realized that when you are in the pointer tool mode and you have the graphic selected, the script works differently than when the graphic is not selected...it uses the irregular edge of the actual graphic instead of the rect boundary when the graphic in not selected.