
its possible you could find some movement script and adapt it to your needs, such as making it move at a certain speed to a certain point
( ,
Wed 3 Mar 2004, 16:09,
archived)

www.wildform.com/tutorials/draganddrop/?sid=P3OP-NLEP-3fc088299622d&ref=
which has the smooth-bit included - however it no longer works when i set it up for multiple targets (as we discussed last night)
I can't see where i'm going wrong so just wondered if you knew what the relevant section was..
i assumed it was the "/5" part, but if i include that, the drag just moves a small (1/5?) distance towards the target - without it it snaps in one frame
( ,
Wed 3 Mar 2004, 16:13,
archived)
which has the smooth-bit included - however it no longer works when i set it up for multiple targets (as we discussed last night)
I can't see where i'm going wrong so just wondered if you knew what the relevant section was..
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
i assumed it was the "/5" part, but if i include that, the drag just moves a small (1/5?) distance towards the target - without it it snaps in one frame

this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
so it takes the current position takes off your final xy each time, try putting /5 in the () or spaces somewhere
or perhaps you need an onclipevent(enterframe) {
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
}
because then it will move slowly back, /5 should be the speed. You might need an if clause to stop it though so it doesn't use up cpu power when still doing that equation
( ,
Wed 3 Mar 2004, 16:22,
archived)
this._y -= (this._y-this.myFinalY)/5;
so it takes the current position takes off your final xy each time, try putting /5 in the () or spaces somewhere
or perhaps you need an onclipevent(enterframe) {
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
}
because then it will move slowly back, /5 should be the speed. You might need an if clause to stop it though so it doesn't use up cpu power when still doing that equation

i think i get it - i will have a bit more of a fiddle ;)
cheers again!
( ,
Wed 3 Mar 2004, 16:31,
archived)
cheers again!

it will never actually get to its target (thoertically)
although I like your logic.
I also like flash mx
( ,
Wed 3 Mar 2004, 16:22,
archived)
although I like your logic.
I also like flash mx

you just need to keep doing it until you are close enough, so in the next frame put a gotoandplay back to this frame.
This causes it to loop forever, so in this frame, you need to check if it's as near as dammnit to where it should be, along the lines of
if abs(this._x-this.myFinalX)
( ,
Wed 3 Mar 2004, 16:37,
archived)
This causes it to loop forever, so in this frame, you need to check if it's as near as dammnit to where it should be, along the lines of
if abs(this._x-this.myFinalX)