views:

99

answers:

1

I have two timelines in JavaFX that moves an image on the screen. One is in the onMouseEntered function to move the image left, and the other in the onMouseExited function to move the image back to the right. The keyframe has translateX starting at 0 and going to 10, and the other starts at 10 and goes to 0. The problem is that the two timelines don't move the image the same distance, so that if you activate it several times it starts creeping to the right. Is there something I'm missing here? How do I set up an animation so that it moves the same distance forward and backward?

A: 

Figured it out, the return trip should make translateX go to 0, not to -10

josiahdecker