View Full Version : it wont follow!!!???!!!
<---KEVLORD--->
June 26th, 2003, 12:26 PM
i want an mc to follow an mc but my code:
onClipEvent (load) {
this._x = _root.attach.car_x;
this._y = _root.attach.car_y;
}
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:.
ahmed
June 26th, 2003, 12:34 PM
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'.. :)
<---KEVLORD--->
June 26th, 2003, 12:36 PM
thanx;)
<---KEVLORD--->
June 26th, 2003, 12:47 PM
vote on the poll!:d
<---KEVLORD--->
June 26th, 2003, 03:24 PM
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:
<---KEVLORD--->
June 27th, 2003, 04:06 PM
somebody else............
lostinbeta
June 27th, 2003, 05:03 PM
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 :) 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 :P
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.