Moving box back to xpos when reaches certain x coord


i just read your tutorial about making an object move from one side to another by using actionscript. so now i was wondering how to make the box get back into the same place as it started when it reaches a certain point.

can someone please help me with adding the code to this AS i already got:

onClipEvent(enterFrame) {
    speed = 5;
    this._x += speed;

thank you very much