Drag and drop variables
Feb 06, 2015
By
Meesh Ross
Is there a way to reset a variable to 0 when the user completes an action?
I'm creating a drag and drop interaction with a change in variables depending on where the object is dropped. So for instance, if the object is dropped on a blue square, x=1, if dropped on a green square, x=2. There will be a graph to show the value of x once the object is dropped. I can set that up pretty simply, but I want the user to be able to move the object to a different drop location and see the new value of x rather than the addition of the two values for x.
Can this be done?
5 Replies
Have a look at the attached file and see if that's what you want. To set/reset a variable (rather than adding to it), you could use a trigger with an Assignment operator, like the one I used on the red rectangle. Hope that helps
That's a good alternative. I was hoping for something that would automatically adjust the variable if moving from the green to blue (assuming they had different values) without having to reset it.
I'm not sure I understand exactly what you are trying to do then. See the attached, revised file. Is this more like it?
This is exactly what I wanted. Thanks so much!
Glad that Michael was able to assist you here Michelle!
This discussion is closed. You can start a new discussion or contact Articulate Support.