Some help with a piece of coding

Hello. I need some help with a piece of coding. On the click of a button, pics change position. However, I want the pics to change position on their own, without the use of any buttons. To give you a basic idea here is the code:

Button 1

on(press){
first_yPos = 0;
}

Button 2

on(press){
first_yPos = -250;
}

I’m quite sure there is a way for the pics to move with a/s, I just don’t know how. Please help!! Thank you