Forum Discussion
Issue with capturing data from a slider
Hello, my interaction is supposed to work in the following way:
- slides the slider to correct bit (with the number percentage changing accordingly alongside)
- writes text in the box
- this continues until the last slide, where the results are displayed
I know it is a very simple interaction, but I have a small bug: the data from the slider is not being captured.
It is working in P3 (click to see), but not E2 (click to see) (and a few other ones I have that I've not uploaded, that need fixed), and I can't see what the different between them is, so I can also fix the rest. Maybe I've been looking too hard and can't see the wood for the trees!
I have attached the SL file, with both the scenes in there, along with the review links above. Thanks in advance for help.
- MichaelHinzeCommunity Member
In scene P3, you use the slider variables (e.g. slider58) directly. In the E2 scene, you want to, for whatever reason, reflect the changing slider variable (e.g. slider72) in another variable (e.g. E2_1), so you need to adjust your triggers as shown in the screenshot.
- MhairiLongmuirCommunity Member
Sorry I'm not sure what you mean.
- WaltHamiltonSuper Hero
This trigger (and all the ones like it) has confused me, SL, and I'm sure you. You need to give sliders and variables different names. I recommend something like Slide X and SliderX Variable at the very least. Much better is to name the variable to reflect the data they actually contain, like powerImportancePercentage. Good names prevent the confusion that exists in triggers like this:
Which Slider58 is being set to which Slider58?
Click on the first Slider58, and you will see that it refers to a project variable. Click on the second, and you will see that it refers to the same project variable, essentially setting this variable to what it already is.
This variable is set to itself when the slider loses focus, but isn't connected in any way to the slider.
Variables and sliders work together without triggers from you. When the slider moves, the attached variable changes. You can tell what variable is attached by selecting the slider, clicking Design and looking for the Variable box. If you slide the slider, the variable changes. If a trigger changes the variable, the slider moves to match it. You probably don't need any of those triggers.
- MichaelHinzeCommunity Member
The sliders, variables in the two scenes are set up differently, and therefore you also need to change the triggers accordingly. See attached a file that fixes the issues.
- MichaelHinzeCommunity Member