It wont follow!?!

i want an mc to follow an mc but my code:

[COLOR=red]onClipEvent (load) {
this._x = _root.attach.car_x;
this._y = _root.attach.car_y;
}[/COLOR]

doesent works ;( . its a field that has to stay straight and follow the car alltough the car is turning and moving:-.

if you could help id be thankfull:s:.

http://downloads.junioronline.us/details.php?section=3&item=2

MovieClip.prototype.moveMe = function(targetX, targetY, acc)
{
     this.onEnterFrame = function()
     {
          this._x += (targetX-this._x) / acc;
          this._y += (targetY-this._y) / acc;
     };
};

mymovieclip.moveMe(_root.attach.car._x, _root.attach.car._y, 20);

try this, with the mc that’s to follow the car named ‘mymovieclip’… :slight_smile:

thanx;)

vote on the poll!:d

mmmmmmmmmh ok it works… but only once.
in the begin it comes towards the car but then it stays where the car started and it isent FOLLOWING the car.

****!!!
well thanx anyway for your trouble.
maybe somebody else can help me:alien:

somebody else…

Looking at ahmeds code it should work all the time, theres nothing wrong and nothing to make it stop working :-\

Oh, and I voted no on the poll :slight_smile: The forum is a place to post questions and whoever is able to help can help if they want to, so I don’t see a point to having skills in the profile. Unless of course you wanted to hunt someone down and PM them your question and/or PM them to look at your thread, both of those defeat the entire purpose of the forum and I don’t agree with them, so either way my answer is still no :stuck_out_tongue: