State change on hotspot click

Trying to figure out why this doesn't work and hoped to get some inspiration from the community here. (.story file attached)

It *seems* like I should be able to trigger a state change on an object on mouseover of a hotspot (works) AND that I should be able to trigger a state change on clicking a hotspot (not working).

In the attached .story file I've even added a trigger to set the object state on the layer that is opened on clicking the hotspot, but it's still not working.

Any thoughts??

Thanks in advance to this amazing community for any help and insight as to what I'm missing here...

 

**Note, I realize I could probably create a variable, change the value of the variable when the hotspot is clicked and set the state of the object that way, but it seems like I should be able to do it without creating variables and adding additional triggers.

7 Replies
Matthew Bibby

I haven't looked at your file Brian, but have you tried using a shape instead of a hotspot?

So drop a square or whatever, give it a solid fill, then make it 100% transparent.

It'll work better than a hotspot (as it's accessible) and doesn't seem to have some of the weird behaviours that hotspots do.

Hopefully, it helps.

Brian Allen

Great tip Matthew and thank you for the reply.

Tried the transparent shape and it still behaves the same as the hotspot in this case.

The problem seems to be the mouseover. So I've got a mouseover trigger set so that when a user mouses over the button they see a state change.

If I remove the mouseover trigger everything works.

Phil Mayor

It is the mouse over I think this is as you would expect it to work.

On mouse over it is set to Red and continues to be red as you mouse over because that trigger is continually firing.

You click and fire a state change but you are mousing  over so the state stays red, when you mouse out it returns to the initial state when you mouse over because that is what the trigger is set too.

You may get better behaviour using the hover state. But may help to know the context of what you are trying to achieve,

Brian Allen

Thanks Phil... just keeping this one simple... I'd like to have a mouseover effect on the button but once pressed (and slide layer opened) keep that state selected.

I started off trying to use the default built-in hover and selected states but it worked exactly the same.

I get that it's the mouseover effect causing this, but it seems a little crazy that the mouseover is effectively killing the ability to use a selected state.

Phil Mayor

I think there is a way to get what you want.

I would have an object with hover and selected state that look the same. To prevent the user switching it off you could try a visited state instead of selected. Or create another button off stage with a selected state and in a button set with the one on stage. Should t then be able to switch it off.

The one hover trigger is not really preventing g you having a selected state however when you muse out it resets the button to the state before you mouse over.

Sent from my iPhone