Dynamic location of an object

How do I move a line object via a tag value?

To do this, we need to make use of a small script to use the fpmi.gui.moveComponent() function.

The general idea is that you’re going to add a dynamic property to your line component. Make it an integer and lets call it HorizontalPosition. This will be the horizontal position that our script will use to move the component. You’re going to want to bind this property to the tag value that drives the animation.

Lets assume that there is some scaling involved. Lets say my tag goes from 0 to 100, and I want my line to move from X-position 250 to 280. I’d bind my HorizontalPosition property to an expression like this:

toInt({[]MyFolder/MyTag}*.3+250)

Now I just have to add this script to my line by right-clicking on it and choosing “Configure Actions”. Choose the propertyChange event and put this script in it:

if event.propertyName=='HorizontalPosition': fpmi.gui.moveComponent(event.source, event.newValue, event.source.y)

Hope this helps,