I think you're confusing animations with movement lilvee1989 . What you want to do is use on key pressed(if you're making a game for pc) or on touch(if you make for mobiles).
So in your case it would be something like
Event: on left arrow pressed
action: set basketball position to (basketball.x-20, basketball.y)
Event: on right arrow pressed
action: set basketball position to (basketball.x+20, basketball.y)
Modify the 20 to whatever you want, depending on how far you want the ball to move. Hope that helps, if you have anymore questions let us know.