# Next, Prev Frame OnRollover animation, I know how to do it with buttons but

**URL:** <https://forum.kirupa.com/t/next-prev-frame-onrollover-animation-i-know-how-to-do-it-with-buttons-but/54482>\
**Category:** Uncategorized\
**Created:** [June 15, 2004, 2:36am UTC](https://forum.kirupa.com/t/next-prev-frame-onrollover-animation-i-know-how-to-do-it-with-buttons-but/54482 "2004-06-15T02:36:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlkedave](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mlkedave](https://forum.kirupa.com/u/mlkedave)\
**Post date:** [June 15, 2004, 2:36am UTC](https://forum.kirupa.com/t/next-prev-frame-onrollover-animation-i-know-how-to-do-it-with-buttons-but/54482/1 "2004-06-15T02:36:50Z")

</div>

Ok here is the thing, I have the following code on my buttons.  
[AS]  
onClipEvent (enterFrame) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
this.nextFrame();  
} else {  
this.prevFrame();  
}  
}  
[/AS]  
This makes the button animation rewind or play depending on if the mouse is over the button. I want to have this on my buttons but I also want a different movie clip on a different layer to go to the next frame or previous frame depending on the rollover. Basically, I need to know how to add something in addition to:  
[AS]  
this.nextFrame();  
AND  
this.prevFrame();  
[/AS]  
with a different movieclip in replace of “this”. The movieclip is located in my main movie (\_root). But when I tried:  
[AS]  
\_root.MyMovie.prevFrame();  
[/AS]  
it didn’t work. ANy suggestions on how to make it work. THANKS VERY MUCH.

MIke
