Help with condition not working

I have a RP file (attached) with a scroll bar, I am getting the value of the scroll (Y) position to segment it down into 19 scroll values (over the range of 1000 Y Max) I have some logic in the prototype that I have created to demonstrate this issue. Can anyone give me any advice on why the logic is not working? It is explained in the prototype.
HelpWithCondition.rp (1.1 MB)

The logic is basically this…

If GlobalVariable = [[Math.floor(myDynamicPanelWithBScrollBar.scrollY/125) + 1]]
Then Do Nothing… (since I want to detect when the scroll value jumps to the next increment.

btw, If I change the condition to not use global variable values (but for example, put “1” as the value, it works… but I need this to update to the current value once it has changed… so I need to var.

Any help would be greatly appreciated… it appears to be a bug in axure that this condition is not working properly, but open to suggestions.

Hi!

The condition seems to be working fine, but the number you are using as the divisor (in variable gScrollIncrement19) is too large to divide them into 19 categories. Try 52.64, which is 1000/19. (The max scroll is 1000.) Note that this is rounded up (from 52.6315…) so that the last pixel of scrolling doesn’t make it go to 20.

Also, you are displaying your debug status before executing f(scrollSatellite), so you aren’t displaying the latest version of the variables. Note that in the left-hand bar that Axure puts in the browser (that displays the page list by default) there’s a “console” button that among other things shows you the values of all of your global vars.

Joseph, thanks for the QC! I will look at it again… I would be thrilled if it was just bad math on my part :slight_smile:

OK… The reason that the global var is set to 142.85 is that I have 19 objects to show, but (and this was not possible to tell in my dumbed down version that I uploaded…) is that 12 of them are shown at a time. So I really only have 19-12 (7) scroll positions to show… 1000/7.

The reason that I am showing the status before f(ScrollSatellite) is that I want to catch ONLY when the scroll position changes (not every scroll event… but when the calculated position changes.

If you grab the scroll bar, and scroll only a little but up or down so that the ScrollY position is changing but the calculated scroll position is not,… the condition should fall through and NOT call f(ScrilSatelites)

The reason I know it is failing is that I would expect when the ScrollY changes within a calculated scroll position range, it should report “No Change” and it should NOT cal f(ScrollSatellites). The console does not appear to show these calls unless you pay attention to the time stamp… it is calling it for EVERY ScrollY change.

Does this make sense? (I am finding it hard to get the idea across… sorry about that)

Any other ideas?
Thanks for the help!

Still need some help… Axure? Are you there?
thanks

Hi Emgee,

Just wanted to let you know that we’ve received your support ticket about this and one of support team members will be getting back to you as soon as they can. We appreciate your patience!

For anyone following up,

The conditions were set up correctly, but the reason why the first conditional case of the “f(checkForScrollChange)” hot spot widget was not triggering was because the value of the “gSatelliteScroll” variable was getting set to a number with an extra line break, rather than just the number itself, so this was always getting evaluated to false. You can see this by selecting the “f(scrollSatellites)” hot spot widget and opening up the interaction that’s setting the value of “gSatelliteScroll” to:

[[Math.floor(SSC.scrollY / gScrollIncrement19) + 1]]

When taking a closer look, however, you can see the extra line break in this interaction:

This, in turn, was setting the variable to a value Axure RP didn’t recognize. Deleting the line break should fix the issue so the prototype works as expected.

Hopefully this helps anyone running into a similar conundrum!

Wow. I never would have found this. Thank you for the assist!
michael