Swiping two things at the same time

Hi all,

I want to swipe two things (dots and rectangle) at the same time (see link below), however they are swiping seperate but not at the same time/simultaneously. What do I have to change???

Thanks for your help.

Without seeing your .rp file, we’ll have to guess at how you set this up. I can make a guess at your prototype structure, but would be much better if you could post your source .rp file here.

It looks like you have a dynamic panel (dp) for the color squares and are using Swipe Left and **Swipe Right" to change panel states. I cannot tell how the carousel dots (ellipses) are structured, so here are methods that should work for several common ways this might be set up…

  • Dots are in a dynamic panel with three states (just like the color squares.)
    • In your Swipe Left event for the square dp, add another target, pointing to the dots dp (or add another Swipe Left event) and change the dots dp state in the same way, e.g.,
      Set Panel State MyDots to next
    • Or, you could add a Panel State Changed event to the square dp with one conditional case for each state. This is a little more code but can be more reliable and flexible, especially if you have more than one way to change the carousel in addition to swiping (like clicking one of the dots or Next and Previous buttons, etc.) e.g.,

Panel State Changed
Case 1
If state of This equals State1
Set Panel State
MyDots to State1
Case 2
Else if state of This equals State2
Set Panel State
MyDots to State2
Case 3
Else if state of This equals State3
Set Panel State
MyDots to State3

  • Dots are just 3 widgets directly on the canvas, with a Selected Style (blue fill).
    • Assign a Selection Group to all the dots so that only one can be selected at a time. Use the Panel State Changed approach like so,

Panel State Changed
Case 1
If state of This equals State1
Set Selected/Checked
MyDot1 to “true”
Case 2
Else if state of This equals State2
Set Selected/Checked
MyDot2 to “true”
Case 3
Else if state of This equals State3
Set Selected/Checked
MyDot3 to “true”

  • Three dots with border only (or gray border with white fill) and one blue dot.
    Use the Panel State Changed approach like so,

Panel State Changed
Case 1
If state of This equals State1
Move
MyBlueDot to ( , [[LVAR1.left]] )
Case 2
Else if state of This equals State2
Move
MyBlueDot to ( , [[LVAR1.left]] )
Case 3
Else if state of This equals State3
Move
MyBlueDot to ( , [[LVAR1.left]] )

  • // where LVAR1 is a local variable pointing to each unfilled dot, and the “.left” parameter refers to the leftmost pixel of that widget. Since no y-axis movement (up/down) is needed, leave the y parameter blank.
    • You could animate this movement if you’d like, e.g.,
      Move MyDot to ( , [[LVAR1.left]]) ease out cubic 500 ms

Thanks a lot for your help! I figured it out now :slight_smile: