Import .swf to library problem

ok i have this .swf, that is full actionscript, it has some random movement on it and thats it. Now i want to import this into a new project and lay it on top of a certain layer, but when i import it and goto test movie, the actionscript doesnt work. out of flash though the swf works fine… does anyone know whats wrong or how i can do what i want to do?here is my actionscript… the only thing i can think of is that the actionscript refering to _root might be messing things up…

this is on the first frame of my movie

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(aa+bb));
}
MovieClip.prototype.reset = function() {
// Put the movie width in place of 300
width = 300;
var dist, norm;
this.x = this._x;
this.speed = Math.random()*4+2;
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;
};

this is added on each separate bar that moves randomly

onClipEvent(enterFrame){
move();
}

can anyone help me?
thanks in advance.

Hi,

Yes, ‘_root’ is your problem.

If u simply delete all the '_root’s from the code and it should work.
All your functions are at the same ‘level’(not to mistake by _level)
in the hierarchy so there is not need for ‘_root’.

Cheers

SHO