# Animation Suggestion

**URL:** <https://forum.inductiveautomation.com/t/animation-suggestion/8458>\
**Category:** Ignition\
**Created:** [May 16, 2014, 1:28pm UTC](https://forum.inductiveautomation.com/t/animation-suggestion/8458 "2014-05-16T13:28:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [May 16, 2014, 1:28pm UTC](https://forum.inductiveautomation.com/t/animation-suggestion/8458/1 "2014-05-16T13:28:35Z")

</div>

I have two blocks that i need to move based on a boolean value, Im not looking for anything crazy. I just want to move the block in the X direction from position 800 to 850 when the boolean is true and then back to spot 800 when the boolean goes back to zero.

Does anyone have any suggestions on how to actuate this?

I was simply going to use an expression on the x value and move it based on the tag but if there are other options i would like to know.

Thanks!

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [May 16, 2014, 5:54pm UTC](https://forum.inductiveautomation.com/t/animation-suggestion/8458/2 "2014-05-16T17:54:18Z")

</div>

The best method would be with an expression. Nice and simple.

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [May 16, 2014, 7:52pm UTC](https://forum.inductiveautomation.com/t/animation-suggestion/8458/3 "2014-05-16T19:52:03Z")

</div>

is there any way to slow the movement? maybe with a timer? I tried but i couldn’t get the timer to reverse its count. Any suggestions? Thanks

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [May 16, 2014, 10:07pm UTC](https://forum.inductiveautomation.com/t/animation-suggestion/8458/4 "2014-05-16T22:07:20Z")

</div>

I worked up a way to move animate an object. One part of the script will move the object right and the other will move it left. You will need to figure out how you want to trigger this.

[code]move = event.source.animate  
x = event.source.relX

if event.propertyName == “animate”:  
if x \>= 50 and x \<=99:  
newX = x + 1  
event.source.relX = newX  
if x == 99:  
event.source.parent.getComponent(‘Timer’).running=0   
if x \<= 100 and x \>= 50:  
newX = x - 1  
event.source.relX = newX  
if x == 51:  
event.source.parent.getComponent(‘Timer’).running=0 [/code]

The timer component I used is set to

Delay(ms) 50  
Initial Delay(ms) 50  
Step by 1

This should get you started
