PDA

View Full Version : I need help stopping a drag actionscript...



corrigon
July 23rd, 2003, 01:19 PM
Hiya,
Im using this actionscript:
http://www.kirupa.com/developer/mx/followease.htm

But want to be able to start and stop the drag effect.


How do i do this?

Please help,

-corrigon:sigh:

andr.in
July 23rd, 2003, 01:23 PM
change
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

to...

onClipEvent (enterFrame) {
if(_root.drag)
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
}

then apply these actions to the button:
on(release) {
if(!_root.drag) {
_root.drag = true;
} else {
_root.drag = false;
}
}

The button just changes a variable stored in _root to true/false and the if() in the other code checks it!

corrigon
July 23rd, 2003, 01:25 PM
thank!!!!!!!!!

flash is very complicated but im getting ther!