Variables
May 01, 2013
I have a need to create the following with variables:
I want the user to be able to click a button 5 times and each time a different picture will display. Someone did suggest using a variable that adds but I'm having problems making that work.
I have to use variables (this is a work sample for a new job)
Any suggestions
Thanks
4 Replies
Hi Karen,
I have had a quick look at your request and attach a demo .story file that you can disect![](https://articulate-heroes.s3.amazonaws.com/smileygnif0k.png)
I hope it helps!
Antony
Hi Karen,
See if this meets your needs. I've only done 3 pictures, but you should get the idea
Create a number variable. I called mine count. Default is set to 0.
Insert a button and create a trigger for the button that
ACTION: Adjust variable
VARIABLE: count
OPERATOR: Add
VALUE: Value 1
WHEN: User clicks
OBJECT: the button you inserted
Insert the pictures. In my case, I made the initial state of all 3 hidden.
Then I created triggers to change the state of the pictures when the user clicked the button. For example:
ACTION: Change state of
ON OBJECT: Picture 1 Balloon flower
TO STATE: Normal
WHEN: User clicks
OBJECT: Button 1
ON CONDITION: count=1
and, if you check out the triggers, the BE Susans display if the count=2; the vinca displays if the count 03
Yes, thank you both!! It does help. I was running into an issue because I had the initial variable set to text instead of number. This caused the bulk of my confusion as I couldn't get the trigger to add.
Both of your examples does it much more elegantly than mine did. Thank you so much.
Karen;
I made a short demo as well that does this on the single layer if you needed that vs layers. The layers method is more efficient for amount of triggers but may not meet your needs if you need to stay on one layer.
Tim
This discussion is closed. You can start a new discussion or contact Articulate Support.