Groups | Blog | Home
all groups > flash actionscript > september 2005 >

flash actionscript : A little help with mouse follow


Dragonusthei
9/12/2005 9:42:45 PM
Hi

Im trying to make is so when my house goes over movie clip "mo" it makes a
movie clip inside mo follow the mouse but just around the mo movie clip heres
the current action script im failing with plz help

onClipEvent(enterFrame){
this._x = mo._xmouse;
this._y = mo._ymouse;
}

Thanks
Hudey
9/12/2005 10:10:55 PM
Create an invisible button over the top of "mo" and add this ActionScript to it:

on(rollOver){
_root.mouseover = true;
}
on(rollOut){
_root.mouseover = false;
}

Then, on the movie clip that you want to follow the mouse, add this
ActionScript:

onClipEvent(enterFrame){
if(_root.mouseover==true){
this._x = _root._xmouse;
this._y = _root._ymouse;
}
}

HTH
AddThis Social Bookmark Button