# Next and prev frame question... plz tell me whats wrong with this simple AS

**URL:** <https://forum.kirupa.com/t/next-and-prev-frame-question-plz-tell-me-whats-wrong-with-this-simple-as/68258>\
**Category:** Uncategorized\
**Created:** [October 23, 2004, 4:21pm UTC](https://forum.kirupa.com/t/next-and-prev-frame-question-plz-tell-me-whats-wrong-with-this-simple-as/68258 "2004-10-23T16:21:44Z")\
**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:** [October 23, 2004, 4:21pm UTC](https://forum.kirupa.com/t/next-and-prev-frame-question-plz-tell-me-whats-wrong-with-this-simple-as/68258/1 "2004-10-23T16:21:44Z")

</div>

Ok here is the AS i am having trouble with  
[AS]  
onClipEvent (enterFrame) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
\_root.this.nextFrame();  
} else {  
\_root.this.prevFrame();  
}  
}  
[/AS]  
I want to make it so when i roll over my movie clip (that i attach this AS to), a different movieclip is controlled. This AS  
[AS]  
onClipEvent (enterFrame) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
this.nextFrame();  
} else {  
this.prevFrame();  
}  
}  
[/AS]  
Works great, when using ‘this’ for the prev and next frame control but i cant figuire out how to control a different movieclip on root. Thanks a TON.

MIke
