Page 1 of 1

Polygon area mouseovers

Posted: Sat May 09, 2009 3:38 pm
by stevex64
Hello,

Chances are very good this kind of thing has been addressed but I haven't found it so far.

I need to make an interactive map of the United States and Canada (and possibly more countries to come). It needs to have mouseover areas defined by the state/province borders, so just rectangular mouseover areas won't work. Is there any way to achieve this, short of making a group of small rectangles within each state/province and assigning mouseovers to them?

Thanks,

Steve

Posted: Sat May 09, 2009 4:51 pm
by bn
Steve,

make a polygon of any shape, set the opaque of the graphic to true. Set the tooltip of this graphic to the name of the state. Then put into the script of the graphic:

Code: Select all

on mouseEnter
   put "I entered" && the tooltip of me
end mouseEnter

on mouseLeave
   put "I left" && the tooltip of me
end mouseLeave
Of course you can do your processing in the handlers of the cards, not just show the name in the message box.
If you have a lot of processing then you might want to put the handler for the processing into the card script and just call this handler from the mouseEnter or mouseLeave.

If you just want to show the name of the state the script might not be needed. Just the tooltip will show after a short delay the name of the state.
regards
Bernd

Posted: Sat May 09, 2009 5:07 pm
by stevex64
Excellent, thank you! Almost every time I post to this forum, I know the answer will turn out to be simple.