
doesnt do the little patch of water between the UK and France... :(
( ,
Wed 3 Mar 2004, 15:58,
archived)

got my drag/drop quiz working now - thanks
wonder if i could pick your brains a little more - do you know how to "tell" something to take more than one frame to get to it's target within actionscript? at the moment they jump immediatly to their targets/home and i would like them to glide gracefully ;)
i.e. tweening, but from within actionscript
( ,
Wed 3 Mar 2004, 15:59,
archived)
wonder if i could pick your brains a little more - do you know how to "tell" something to take more than one frame to get to it's target within actionscript? at the moment they jump immediatly to their targets/home and i would like them to glide gracefully ;)
i.e. tweening, but from within actionscript

then put the movement after that. give it an instance name and tell it to play
( ,
Wed 3 Mar 2004, 16:04,
archived)

the MC is being dragged, so it could be dropped anywhere - i.e. i couldn't have the movement within the MC as it would change each time it was dropped (is this right?)
( ,
Wed 3 Mar 2004, 16:06,
archived)

the drag MC after youve dragged it?
( ,
Wed 3 Mar 2004, 16:07,
archived)

the user will drag it to a target, and it will slide to the centre - if they drop it off-target it will slide back to it's start position.
( ,
Wed 3 Mar 2004, 16:09,
archived)

if (correct = true) {
_root.draggable;
gotoandplay(2);
} else {
//it wont work for this it'll just snap back
}
( ,
Wed 3 Mar 2004, 16:11,
archived)
_root.draggable;
gotoandplay(2);
} else {
//it wont work for this it'll just snap back
}

i would think it would go to somewhere relative to the place it was dropped, rather than a pre-determined absolute location?
( ,
Wed 3 Mar 2004, 16:16,
archived)

but i dont know off the top of my head.
www.flashkit.com
has some useful things you can download. search the galleries for something similar.
( ,
Wed 3 Mar 2004, 16:18,
archived)
www.flashkit.com
has some useful things you can download. search the galleries for something similar.

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)