# Move to next screen from Nav MC

**URL:** <https://forum.kirupa.com/t/move-to-next-screen-from-nav-mc/159739>\
**Category:** flash\
**Created:** [August 19, 2005, 5:57pm UTC](https://forum.kirupa.com/t/move-to-next-screen-from-nav-mc/159739 "2005-08-19T17:57:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andtheniran](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@andtheniran](https://forum.kirupa.com/u/andtheniran)\
**Post date:** [August 19, 2005, 5:57pm UTC](https://forum.kirupa.com/t/move-to-next-screen-from-nav-mc/159739/1 "2005-08-19T17:57:28Z")

</div>

Hello,

I have set up an animated, dropdown navigation MC and put it on my root slide. Problem I am running into is when I add actionscript to each of the buttons so that each one goes to a particular slide, nothing happens.

If I drag an instance of one of the buttons out onto any of the screens (root or any other one) and add actionscript to it, it works great.

I figure since my buttons are inside of an MC, the actionscript must need to change to recognize the screens outside of the MC…

How would I change my current script to do this? Here’s my script:

_on (release) {_

- // GoTo Screen behavior  
if((this.\_parent.slide2 != undefined) && (this.\_parent.slide2 != null))  
{  
var screen = null;  
var target = this;  
while((screen == null) && (target != undefined) && (target != null))  
{  
if(target instanceof mx.screens.Screen)  
{  
screen = target;  
}  
else  
{  
target = target.\_parent;  
}  
}  
if(screen instanceof mx.screens.Slide)  
{  
screen.gotoSlide(this.\_parent.slide2);  
}  
}  
// End GoTo Screen behavior

}\*
