The previous script will work if you just want your object to move once; the Flash movie wont recognize the far/right edge of the stage, so the object will just keep moving and the ActionScript will keep cycling long after its out of sight, unless we add some kind of conditions to determine when it should stop moving the symbol. For that we can use an
if statement, inserted inside the onClipEvent(enterFrame) and nested outside of the this._x=this._x+5:
onClipEvent (load){
this._x = 10;
}
onClipEvent (enterFrame) {
if (this._x<=625)
this._x = this._x+5;
}
}
For the condition of my if statement, Ive told Flash that its only supposed to move my symbol to the right by 5 pixels if its current center points position is less than or equal to 625 pixesl from the left edge of the stage. This prevents the symbol from moving any farther beyond x coordinate 625.