Relocating by Click

Hi guys, I’m new in Axure,
trying to make an action. when click on a btn make another object moves down, and by the second click make that object move back in original place.
any direction, pls?

There are lots of ways to do this. I’d suggest something simple like the attached which requires only one case statement.

It uses a hidden label widget to determine the direction to move. It defaults to positive 1. When you click the button it moves by a set value times the hidden widget and then multiplies the value by -1. So after you click, the 1 becomes -1 so that when you click it again it will move back the same amount. That will loop eternally :slight_smile:

You could just as easily use a global variable instead of the hidden text label if that makes you happy. You could probably also do something with toggling selected state and using two cases.

moveUpandDown.rp (48.4 KB)

Great!
That is exactly what I need to do,
still, when I hit the second one, the object (which is a group) doesn’t move back, and I don’t really understand the codes like [[LVAR1*100]] in Fix palette, I need to practise more.
Thanks a lot :slight_smile:

If you can share you file I can take a look to see why it’s not moving back. The LVAR1 here is just grabbing the text on the hidden widget label which starts out as 1 and then flips the sign each time you click.