Moving image when button released

this is old and I used to know but forgotten over time. How do you scroll an image across to a certain point when a button is released?

Preferably with easing.


function imageMover(finalX,finalY){
pathToImage._x += (pathToImage._x - finalX)/2;//change the 2 to a bigger number for smoother easing
pathToImage._y += (pathToImage._y - finalY)/2;
if(Math.floor(pathToImage._x)==finalX && Math.floor(pathToImage._y)==finalY){
moveImage = setInterval(this.imageMover, 50, 234, 432);//234, 432 are the final x y coordinates

This was written on the fly but it should work, just put it on the button, and modify the path to the image you want to move…and if it doesn’t work this topic gets covered every other day or so, so you might consider a search for more info than I can provide.