Problems with changing states (Adding and Subtracting States?)

Mar 24, 2015

Hello there,

So, I am creating an interactive module that basically allows users to turn lights on and off.  Imagine there are 3 lights (keylight, backlight, and fill light) in a room.  I have created 3 buttons that can be selected that turn the lights on.  I have an image layer on the timeline with different states.  My idea was that as the user activates different buttons, the image layer changes to reflect which lights are on.  For example, if a user clicks "Keylight" the image will show a person with only 1 light shining on them.  However, if the user then clicks "Backlight" the image will change to show two lights on.

 

This all works fine.  The tricky part comes in when the user wants to turn OFF a light.  Take the above example.  "Keylight" and "Backlight" are both activated and the image layer is in a state which shows both lights are on.  However, if the user deselects "Backlight," the image does not change back to the state of only having "Keylight" on.  Help!

 

I have attached my story.html file.  Is the last slide (1.11)

6 Replies
Michael Hinze

Grouping the triggers all on one layer makes sense (at least to my tired brain :-)) for two reasons:

1. you cut down on the number of triggers that are connected to the various clickable items on the base layer, and 

2. You may have noticed that the very first trigger on the layer, `turns off` the image first, then immediately after that changing it to the correct state. This way you only have to check which buttons are selected everytime a button on the baselayer is clicked. Hope that makes sense.

This discussion is closed. You can start a new discussion or contact Articulate Support.