I have this example of hw to make a movie clip follow the mouse by using the
current position of the mouse (_Mousex and _mousey)...but now i wnt the movie clip to
go the opposite direction of the mouse..4 e.g if the mouse is @ Y=5 and X=2 then the movie clip 2
b @ Y=-5 and X=-2...is there a way of doing this,thanx
Graffixnerd 0 Newbie Poster
Recommended Answers
Jump to PostThe below code will work
onClipEvent (load) { var speed = 10; } onClipEvent (enterFrame) { //position of the movie clip =position of the mouse -prev position of the movie clip at that speed _x = -(_xmouse - this._x)/speed; _y = -(_ymouse - this._y)/speed; _x+=200; _y+=100; }
Jump to PostThe below code will work
onClipEvent (load) { var speed = 10; } onClipEvent (enterFrame) { //position of the movie clip =position of the mouse -prev position of the movie clip at that speed _x = -(_xmouse - this._x)/speed; _y = -(_ymouse - this._y)/speed; _x+=200; _y+=100; }
All 6 Replies
iScript 0 Newbie Poster
Graffixnerd 0 Newbie Poster
iScript 0 Newbie Poster
Graffixnerd 0 Newbie Poster

rajarajan2017

rajarajan2017
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.