Ship engine sprites?

Hi all,

I have a ship that I would like to add engine/exhaust sprites to. I used the car code from another post in the forum (see below)

I found a sprite code from here :
http://www.friendsofed.com/download.html?isbn=1590592115

However, I can’t get the sprites attached to the ship. I think it my be the _root syntax, but its a bit too much code for me to internalize at this point. I think I might have one too many onEnterFrames or something like that. Any thoughts?

SPRITE CODE :


c = 10;
this.createEmptyMovieClip("blank_mc", 1);
blank_mc.onEnterFrame = function() {
    // step 1: Where's the mouse pointer right now?
    currx = car._x;
    curry = car._y;
    // step 2: If it's not in the same location is was last time
    if (!(prevx == currx && prevy == curry)) {
        // step 3: Create a new instance of "mc"
        _root.attachMovie("mc", "mc"+c, c);
        // step 4: Place the instance at the mouse pointer's position and set size of new instance
        with (_root["mc"+c]) {
            _x = currx;
            _y = curry;
            _width = 0;
            _height = 0;
        }
        // step 5: Create an enter frame action for each new duplicated mc
        this._parent["mc"+this._parent.c].onEnterFrame = function() {
            // Set variable to count the number of frames played
            this.i++;
            // Increase circle by (x) pixels
            this._width += 1.4;
            this._height += 1.4;
            // Decrease alpha by (x) amount
            this._alpha -= 100/60;
            // If frame reaches 60, remove mc
            if (this.i>=60) {
                this.removeMovieClip();
            }
        };
        // step 6: Increase the c used for instance names
        _root.c++;
    }
    // step 7: Store where the mouse was, so we can compare that info
    // to the position in the next program cycle
    prevx = currx;
    prevy = curry;
};

ALL OTHER CODE :


/**HITTEST HACK**/
import flash.geom.Point;
import flash.display.BitmapData;
MovieClip.prototype.pixelHitTest = function(mc:MovieClip):Boolean  {
    var thisBitmap:BitmapData = new BitmapData(this._width, this._height, true, 0);
    thisBitmap.draw(this);

    var mcBitmap:BitmapData = new BitmapData(mc._width, mc._height, true, 0);
    mcBitmap.draw(mc);    
    
    if(thisBitmap.hitTest(new Point(this._x, this._y), 0xFF, mcBitmap, new Point(mc._x, mc._y))) {
        return true;
    }
    return false;    
}
/**HITTEST HACK**/

/**ALIEN SCRIPT**/
function getdistance(x, y, x1, y1) {
    var run, rise;
    run = x1-x;
    rise = y1-y;
    return (_root.hyp(run, rise));
}
function hyp(a, b) {
    return (Math.sqrt(a*a+b*b));
}
MovieClip.prototype.reset = function() {
    width = 1024;
    height = 768;
    var dist, norm;
    this.x = this._x;
    this.y = this._y;
    this.speed = Math.random()*4+5;
    this.targx = Math.random()*width;
    this.targy = Math.random()*height;
    dist = _root.getdistance(this.x, this.y, this.targx, this.targy);
    norm = this.speed/dist;
    this.diffx = (this.targx-this.x)*norm;
    this.diffy = (this.targy-this.y)*norm;
};
MovieClip.prototype.move = function() {
    if (_root.getdistance(this.x, this.y, this.targx, this.targy)>this.speed) {
        this.x += this.diffx;
        this.y += this.diffy;
    } else {
        this.x = this.targx;
        this.y = this.targy;
        if (!this.t) {
            this.t = getTimer();
        }
        if (getTimer()-this.t>1000) {
            this.reset();
            this.t = 0;
        }
    }
    this._x = this.x;
    this._y = this.y;
};
/**ALIEN SCRIPT**/







/**STAR SCRIPT**/
for (i=0; i<15; i++) {
    star.duplicateMovieClip("star"+i, 100+i, {_x:random(1024)+10, _y:random(768)+10, _alpha:random(70)});
    this["star"+i+"down"] = true;
}
onEnterFrame = function () {
    for (i=0; i<50; i++) {
        if (this["star"+i+"down"] == true) {
            if (this["star"+i]._alpha<=0) {
                this["star"+i+"down"] = false;
            }
            this["star"+i]._alpha -= (random(40)-10)/5;
        } else if (this["star"+i+"down"] == false) {
            if (this["star"+i]._alpha>=70) {
                this["star"+i+"down"] = true;
            }
            this["star"+i]._alpha += (random(40)-10)/5;
        }
    }
};
/**STAR SCRIPT**/


/**SHIP SCRIPT**/
var steeringAbility:Number = 1.3
var maxspeed:Number = 30;
var maxSpeedoRotation:Number = 160;
var accel:Number = -10;
var steer:Number = .08;
var drift:Number = .9;
var speed:Number = 0;
var traction:Number = 10;
var holdArr:Array = [0, 0];
var angle:Number = 1;
var brakeForce:Number = .8;
car.onEnterFrame = function() {
    so._rotation = (speed/maxspeed*maxSpeedoRotation)
    car._rotation = angle*180/Math.PI;
    if (Key.isDown(Key.RIGHT) || Key.isDown(Key.LEFT)) {
        angle += (Key.isDown(Key.RIGHT)-Key.isDown(Key.LEFT))*steer*(Math.abs(speed)<10 ? Math.abs(speed)/10 : 1)* steeringAbility;
    }
    if (!Key.isDown(Key.UP)-Key.isDown(Key.DOWN)) {
        car.flames._visible = false;
        speed *= drift;
        car.ship_glow._alpha = 0;
    } else if (Key.isDown(Key.UP)-Key.isDown(Key.DOWN) && !Key.isDown(Key.SPACE)) {
        speed = Math.min(Math.max(speed+(Key.isDown(Key.UP)-Key.isDown(Key.DOWN))*.99, accel), maxspeed);
        car.ship_glow._alpha = 100;
        car.flames._visible = true;
    }
    Math.abs(speed)<.99 ? speed=0 : null;
    if (Key.isDown(Key.SPACE)) {
        speed *= brakeForce;
        if (speed>1) {
            steer = .099;
        }
        traction = 50/3;
    } else {
        traction = Math.max(1, Math.abs((speed-10)/3));
        steer = .08;
    }
    speed<0 ? traction=1.0 : null;
    car._x -= holdArr[0] += ((Math.cos(angle)*speed)-holdArr[0])/traction;
    car._y -= holdArr[1] += ((Math.sin(angle)*speed)-holdArr[1])/traction;
    if (car._y < -60) {
        car._y = 768;
    } else if (car._y >1000) {
        car._y = 0
    }
    if (car._x < -190
        ) {
        car._x = 1024
    } else if (car._x > 1255) {
        car._x = 0
    }
    
    /**ALIEN/CAR HIT TEST**/
    if (car.pixelHitTest(alienA)) {
    car._x = earth._x
    car._y = earth._y
    }
    /**ALIEN/CAR HIT TEST**/
    
    /**ALIEN/EARTH HIT TEST**/
    /**ALIEN/EARTH HIT TEST**/
        
    
};
/**SHIP SCRIPT**/