PDA

View Full Version : moving object to a certain position


gencogluMX
02-03-2009, 06:24 PM
hi,
The following code works fine when mouse is pressed at any position on the screen ,object moves that position...but what if I want the object move that position at a certain speed..say+10 using setInterval...I mean I want my object move slowly to any position I click on the screen..
How do you modify the code ?
thanks

onClipEvent (mouseDown) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}

endergrl
02-03-2009, 09:38 PM
you would need to create a motion tween. you will need to import the tween class to do that. Here is some good info for as3, is that what you are using?

http://www.flashandmath.com/basic/tween/

atomic
02-03-2009, 10:00 PM
See attached...

gencogluMX
02-03-2009, 10:14 PM
I tested the files but they are all in AS3 and mine is flash 8 AS2..

gencogluMX
02-03-2009, 10:17 PM
Thanks Atomic ..your code works great...

atomic
02-04-2009, 02:44 AM
Grrrrreat! ;)