Animating back and forth on rollover and out! HELP!

Hi, i’ve been using this code

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}

to animate small buttons back and forth when they are rolled over and off. and it looks great, and works perfectly.

Now i want to have the same action in a movie clip that i have placed on the stage it will fade in and expand when that button is rolled over, and of course reverse its animation if its rolled off of.

how do i get the button with the above code also target a movieclip and make it animate concurrently???

thanks for any help!!!

vanillacoke

You’ll have to use a script similar to this.[AS]onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.myMovieClip.nextFrame();
} else {
_root.myMovieClip.prevFrame();
}
}[/AS]
myMovieClip would be the instance name of the movieclip you’re trying to target.

:thumb: :thumb: :thumb: :thumb: :thumb:

Aces! that did it!

i was missing the (_root) part btw.

THANKS ALOT!!!

I added _root because I assumed that the movieclip you’re trying to fade was located on the main timeline. _root refers to the main timeline.

Well I’m glad it worked. =)