Needle continues to bounce

I have created a gauge that works based on text inputs or sliders. In the first screen you would enter your Age, Income and Savings. Those values are loaded onto the next page. Depending on what you choose, it will place the gauge in the appropriate place. This seems to be working ok.

The second screen is where I’m having problems.

First Problem
There’s a lot going on here so I’ll try to explain in as much detail as I can. When the user arrives, some defaults will be set based on the previous screen & the gauge will land somewhere based on this. When user moves the sliders around, the gauge should move logically. The first section, risk works fine. The second section, age (age.txt -image attached)dial.rp (506.7 KB)
does not move correctly. The first case says if text on this is less than 50 then rotate back to a certain position. What happens though, when you move the slider to a number lower than 50, the gauge bounces around that many times. For example if I moved it to 45, the gauge would bounce back and forth 5 times before it stops. If I set it to 30, it would bounce 20 times, etc. The way it should work, when you move it under 50, it moves to that position and stops but does not bounce around.

Second Problem
In the first screen I have the 3 fields. User enters info and those inputs are carried over to the next screen. In the age slider section, is there a way to make the minimum age reflect the age that a user enters in the screen previously? So in the first screen I enter 35. Inputs carry over to next page and the sliders min age is 35, I can’t slide any lower then that.

I have attached my RP file.

Thank you in advance!

Your first problem actually has a very simple cause: when you slide the slider less than fifty, it hits every number on the way. Each time the text changes, the OnTextChange event fires (50 to 49, text change; is it less than 50? Yes. 49 to 48, text change; is it less than 50? Yes. And so on). Each time it fires under fifty, the condition is true, so it queues up one animation.

You’ll need another way to track when the event fires, if the under-50 animation already happened, then don’t do it again: basically you need to track state. You could do this with a variable or even the selected state of a widget that you toggle each time the value goes above 50 or below 50.

Your second problem is solved with global variables. When the user enters the info, also save that value to a global variable. On your next page, use an OnPageLoad case to check the value of those variables and update anything that needs updating based on those values.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.