For a specific class task I've been set, I need to make my ship move from one side of the screen to the other. This would be just fine if didn't have to use an actionscript, rather than motion tween...

I've gone to my ship symbol and named the instance "ship". After making a new layer for my actionscript, in Action- Frame I was told to enter:
_root.ship.onEnterFrame = function(){
this._x -= 8;
if(this._x < -300){
this._x = 700;
}
}


I've done that, but when I test my movie, my ship just sits there and a compiler error pops up saying:
"1120: Access of undefined property _root."


Please help me? This is my first time making an actionscript so I have no idea at all what I'm doing... >___<"