Checkbox needs to increase and decrease a variable
Jul 26, 2013
By
Alfred Low
I am using checkboxes to keep track of the number of items found on a scavenger hunt.
Everytime the user finds an item, they click the checkbox.
These are the triggers I have written on the checkbox:
"Subtract 1.00 from numFound when the user clicks If checkbox's state is equal to Normal"
"Add 1.00 to numFound when the user clicks If checkbox's state is equal to Selected"
The former rule is for when the user untick the checkbox.
When both rules are in place (and irregardless of the order they appear in), only the Subtract rule works, ie numFound keeps decreasing.
What am I doing wrong?
7 Replies
Hi Alfred!
Welcome to the community and thanks for posting! It would be easier to troubleshoot this problem for you if we can have a look at the .story file and take a closer look at exactly what is going on. Any way you can share the .story file for this? Thanks! =)
HI Alfred,
I've attached a story that I think accomplishes what you're after. I'm open to the community if there's an easier way...seems like you'd need a lot of triggers to get this to work!
Please shout out with any questions.
Thanks @Rebecca. That is exactly what I wanted.
I noticed that you did the addition and subtraction on a Slide Trigger.
My triggers were attached to the Checkbox object itself. Strange that this didn't work but at this point, I will take anything that works.
Cheers
Alfred
Glad it's working for you. Still open to a less complex solution if there is one!
Thanks, Rebecca - that's exactly what I have been struggling with!
My project involves giving someone a "badge" when they complete all real life tasks (checking a box for each task completed).
The Badge layer appears on that category's slide when the variable count reaches the required number, and also disappears if boxes are unchecked and decrease the count. In the end there will be several different badge categories.
My next goal is to have a separate slide show the list of category badges earned. I want the badge collection to show each badge in a dimmed state initially and then to change state to normal when the corresponding variable count has met the requirement.
I have not yet been able to get the state to change at all yet. I will post my story here and if you have a genius tip for me to do that I would be obliged.
Chris McEwen, Univ of WA
Hi Chris and welcome to Heroes!
I took a look at your slide set up, and the problem was that you had set the state of the badge on slide 1.2 to change based on when the variable changed, but that happens on the previous slide. So instead, I changed the trigger to change the state when the timeline starts if countchecked is equal to 3. You also didn't have a trigger to get to that slide, so I added on to ensure the state would change and all worked as expected. I've attached the example I updated here.
Hi Chris,
Welcome to the community. Glad the post from last summer got you started, and that Ashley jumped in with help. Christmas holidays got me really busy, with no time to check into the forums.
Happy New Year, all!
This discussion is closed. You can start a new discussion or contact Articulate Support.