Movement using actionscript

I am pretty new at flash so here is my dilemma.

So i lets say using this actionscript:
onClipEvent(enterFrame) {
speed = 1;
this._x += speed;
}

How do I make it so when I click on an image, it uses actionscript to move it a certin amount and then stop where I want it to.

Thanks.