PDA

View Full Version : Simple problem for all you gurus


sammiegirl
06-21-2001, 08:44 AM
This is a simple problem I know!!!, I have a little boat that I want to follow the mouse smoothly when the user moves it only along the x axis.... however when the mouse is not moving I would like it to still very gradually move towards the mouse again only along the x axis. In addition to this I would like the boat to have a nice deceleration as it comes to a stop ... hope this makes sense to somebody and please if you can help could you explain it to me in really simple terms as I am a bit blonde!!!

thanks a million

Jesse
06-21-2001, 09:16 AM
make your boat an MC and put this code on it:
onClipEvent (enterFrame) {
xdif = (_root._xmouse-this._x)/10;
this._x += xdif;
}

sammiegirl
06-21-2001, 09:35 AM
Thanks Jesse did paste the code in but it didn't work perhaps I put it in the wrong place or something???? got to say am a complete novice when it come to actionscripting may be I need to add a got to frame or summit again replys appreciated

thanks

Jesse
06-21-2001, 11:35 AM
just create a movie clip, put it on the stage, right click > actions, paste... should work fine...
remember that actions are ON not IN the movie clip.

bluefinger
06-19-2002, 02:42 AM
Hey Jesse,

How would you constrain that? Like if I wanted something floating over my nav....u know?

mk