Stop mc motion at a certain point?

The following block of script works as stated on kirupa.com as far as moving to the right via the this._x += speed.

However, I am trying to modify it to stop scrolling if the the x pos. is less than 136. I am a bit of a noob-hack when it comes to actionscript syntax…as you can see below. please help!

Thanks in advance

onClipEvent (enterFrame) {
speed = 1;
this._x += speed;
if (this._x<=136) {
speed = 0;
}
}

  • the movement works, but it dosnt stop…