Ship rotates and flips according to mouse potition?

Hey there. Been making a site and came across a problem. I want to have a ship movieclip follow the mouse slowly and rotate and flip on horizontal axis according to the mouse potition. I’ve been looking on this forum and can’t find much help. Here’s the code on the timeline I got so far but it just makes the movieclip follow the mouse;

ship_mc.onEnterFrame = function() {
    var xMouse = _root._xmouse;
    var yMouse = _root._ymouse;
    if(Math.abs(xMouse - this._x) < 1) {
        this._x = xMouse;
        this._y = yMouse;
    } else {
        this._x -= (this._x-xMouse) / 80;
        this._y -= (this._y-yMouse) / 80;
    }
}

I’ve attached the source file. If anyone can help it’ll be much apprechiated!

Also I’d like to learn aswell so code comments are welcomed!

  • Amy