Changing color of an object on mouse rollover

Hello,

I have a map of the United States and each state is a vector shape. I would like each state to change fill colors when a user rolls their mouse over.

Do I need to make 51 scenes with one state per scene (including DC) a different rollover color? It seems I might be missing something fundamental here.

I guess I could just jump around the timeline and not make additional scenes.

Never mind.
I see that I can easily add custom JS and CSS. I’m kind of stupid. :slight_smile:

Also see my answer to here,

which may help.

Adding to my answer above.

For you map.

You can select sat Texas, double click into it to get to Edit mode.
Now copy its shape. ( cmd + C )

Now add the rect and do the show Button controls as I detail in the above answer.
Then convert the rect to a vector shape.
With the Rect in edit mode. Paste the Texas shape you copied earlier onto it.The rect will take its shape.

You now have a Texas vector shape that you can use Button controls.

This way saves you re drawing all the shape manually.

As shown in this example with Texas.

Map-hover.hype.zip (289.9 KB)

Ahhh - good work on this. Let me try it! Thank you.

This did what I needed it to do - thank you!

1 Like