Revert state of object back to original state, with a click

Jul 07, 2012

Hi,  

I have a button (Text Box 1) which says "Click to Reveal" and after clicking, the button changes to another state, the Answer state, with the answer.

However, I would like the user to be able to click the button again to have it change back to the "Click to Reveal" state. It doesn't seem to be working for me. So far, I've tried placing a trigger with a condition, which reads: Change state of Text Box 1 to "Click to Reveal" when user clicks, IF state of Text Box 1 = Answer.  Is my logic wrong here?, or would the order of the triggers have anything to do with it? The first trigger I use is: Change state of Text Box 1 to Answer when User clicks.  

Thanks everyone! 

Sincerely, 

Ishan

8 Replies
Adrian Dean

Edited this. The link directly below these words contain examples of changing object states and having them revert back to the original state.

http://community.articulate.com/forums/t/13807.aspx

Hi Ishan,

This might help provide some insight. Watch the second screenr video in particular.

http://www.articulate.com/support/kb_article.php?product=st1&id=1keancorydu4

It's not an exact answer to your problem, but it should move you forward and hopefully to solving your issue.

Hope it helps,

Adrian

Ishan Thakore

Hi Adrian, 

Sorry for not getting back to you sooner! I checked out the videos and did end up getting the button to work (I used two different layers just like the 2nd screenr). I'm still not quite sure why my original equation doesn't work, but I'm glad I got the objects to behave how I intended. 

Thanks for the suggestions!

Sincerely, 

Ishan

Laura Winzen

This is a very old thread, but I am looking for a way to accomplish this in Storyline 360. I have a screen full of buttons and each one has a trigger to change it to a particular state when clicked. Is there an easy way to set them to go back to their original state when they are clicked again?

Having a layer for each button is not an option - that would quickly become ridiculous.

Laura Winzen

Hi Walt! So what I need to have happen is for the buttons to turn either green if they chose correctly, or red if they didn't. So I had created two add'l states for each button - Correct and Incorrect.

You're saying if I change the Visited state to the red or green, as appropriate, that will change back and forth when clicked? I just did a test. These buttons don't have a Selected state but they have a Visited state. I changed the Visited button to a different color and removed the red and green states and triggers. In Preview, clicking the button a second time did not change it back to Normal state.

Am I missing what you're suggesting?

Walt Hamilton

Laura,

I was imagining the object having only two options, like the "Selected State" rectangle or the "Change Variable to Correct" textbox in the attached sample.Those are really simple, all you have to do is create the desired "Selected" state, and let it exercise its native superpower (provided you name it "Selected".)

What you want is complicated by having three states, Normal, Incorrect, and Correct.  To do that, you need a third character; a dispassionate observer to inform everybody what the current state of the object is. That can be easily done with a T/F variable, which can be toggled (have its value switched to which ever one it isn't). That is also the principle behind the selected state; you don't have to check which it is, it just changes to the other one.

I could have set the "Click Me" box to do that with only two states. For me the real challenge is knowing when it is clicked whether the click is correct, or not. I settled on an independent variable that is set to True or False. Depending on that value, and the current condition of the "Click Me" box, its state changes. The value of the Correct/Incorrect variable is changed by clicking the "Change variable text box.

Try them all and read their triggers and you'll be on your way.

Laura Winzen

Actually, there is only one right answer so I can just create a Selected state and make it green or red, depending on which is correct. And I have to delete the trigger I made.

I just tested this and it works! Yay!!

Thank you so much for your help, Walt! My dad's name was Walter. Walters are good people. :)