Movieclip follow within btn

I have been trying to get this movieclip to follow the cursor upon rollover of a btn. I tried to put the movie clip inside the button and add script directly to the mc, and it didn’t work. Thanks in advance.

make it a variable


on(rollover) {
_root.follow = 1;
}
on(rollout) {
_root.follow = 0;


if(_root.follow == 1;) {
//follow the mouse
} else {
//don't follow the mouse
}

Place this on the timeline in which your movieclip is in (if youwant it to be a button let me know, I’ll modify the script).


yourbutton.onRollOver = function(){
// delete this.onRollOver
// uncomment previous line if you don't want it to be able to be rolled over again
this.onMouseMove = function(){
this._x = _root._xmouse
this._y = _root._ymouse
}
}

well the movie clip is inside a button, so i can’t add script to the timeline of the button, thats whats confusing.

Ah I see. Why does the movieclip has to be inside the button ? Those are kinda hard to use.

oh, my fault, i have gone over the tutorials on hover captions. Should I just have to add that script you supplied to the timeline? I will mess with it. Thanks so much.

i can’t get it i will just work with the tutorial.