X Movement Action Script

Could someone please tell me how to get the xmovement action script to loop?

This is the code I am using at the moment:

onClipEvent(enterFrame) {
speed = 1;
this._y += speed;
}

Thank you.

I’ve added the code:

onClipEvent(enterFrame) {
speed = 1;
this._y += speed;
}

hi there
the answer is easy you only have to tell your movie clip that when the y coordinate gets to the final point you want it gets back to the beggining
suppose we want a movieclip to move from point 0 to point 100

onClipEvent(enterFrame) {
speed = 1;

if this._y>=100{
this._y=0
this._y += speed;}
else
{

i hope i could be helpful
this._y += speed;}
}

Hello:

For some I couldn’t get your code to work.
But, I thank you for your help.

I ended up using the following code:

onClipEvent(load){
origY = this._x = 1;
}

onClipEvent(enterFrame) {
speed = 1;
this._x > 300 ? this._x = origY : this._x += speed;
}

Thanks again.

This’ll do the same thing that your code does, just without the variable.
I’d do this:
[AS]
onClipEvent(load){
speed=1;
_x=1;
}
onClipEvent(enterFrame){
_x+=speed;
if(_x>=300){
_x=1;
}
[/AS]