To have it update you would need a while loop to set the pos_x to the value of the variable every frame. The way I suggest you do it is create a property for the variable, and update the pos_x within the set clause.

You could create a custom event which fires when the var changes.