# Controling frame move from outside movieclip

**URL:** <https://forum.kirupa.com/t/controling-frame-move-from-outside-movieclip/288928>\
**Category:** flash\
**Created:** [May 23, 2009, 10:16am UTC](https://forum.kirupa.com/t/controling-frame-move-from-outside-movieclip/288928 "2009-05-23T10:16:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sleidia](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sleidia](https://forum.kirupa.com/u/sleidia)\
**Post date:** [May 23, 2009, 10:16am UTC](https://forum.kirupa.com/t/controling-frame-move-from-outside-movieclip/288928/1 "2009-05-23T10:16:37Z")

</div>

Hi everyone 🙂

I have this function :

```auto
function swapstate(newpage) {
    for(var a in nav_left){
        if (nav_left[a]._name != newpage) {
            nav_left[a].gotoAndStop(1);
        } else {
            nav_left[a].gotoAndStop(3);   
        }
    }
}

```

… which is supposed to be triggered from within movieclips like this :

```auto
onSelfEvent (press) {
_root.swapstate(_name);
}

```

As you can see, it’s made in order to change the look of a button when clicked and to also show a different look to the other buttons in the same movieclip container.

The problem is that gotoAndStop isn’t triggered.  
I assume the syntax is wrong ☹

Huge thanks to the ones who will help 🙂
