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
Can you share the actual .story file so that we can have a look at the trigger setup.
Thanks for the reply, Michael. My bad, I chose the wrong file. Uploading the new one now. It is the last slide (1.11)
Have a look at the attached file and see if that`s what you wanted. I organized the triggers all on one layer (this eeemed a cleaner way to do it) and, unless I misunderstood, this works for me.
Yes this works perfectly, thank you Michael. You get a gold star!
If it's not too much trouble, would you mind explaining your thought process here? Why did this work when you put all the triggers on that one new layer?
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.
Glad that Michael was able to assist you here Stephen.
This discussion is closed. You can start a new discussion or contact Articulate Support.