# Navigation selection issue

**URL:** <https://forum.kirupa.com/t/navigation-selection-issue/320598>\
**Category:** Uncategorized\
**Created:** [March 28, 2011, 8:13am UTC](https://forum.kirupa.com/t/navigation-selection-issue/320598 "2011-03-28T08:13:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charldesign](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@charldesign](https://forum.kirupa.com/u/charldesign)\
**Post date:** [March 28, 2011, 8:13am UTC](https://forum.kirupa.com/t/navigation-selection-issue/320598/1 "2011-03-28T08:13:54Z")

</div>

Hello!

I’m trying to make a simple flash navigation, basically it has a hover state, the selected page and a rollOver. nothing hardcore. Ive almost completed it but my script wont add and remove the over states correctly. onRollOver the button changes color, on release it stay that color and is in-acive(cant click anymore) and the same goes for the other buttons. so when a button is clicked its states are removed but they need to be added again when a other button is clicked. there are about 8 of these buttons. Is this the correct way of doing this ? My code is below. on the stage there are movieClips with instance names of btn1, btn2, ect.

Any help would be appreciated.  
Thanks in advance.

#include “mc\_tween.as”

var current\_page = btn1;

page\_checker();

function page\_checker(){

```
if (current_page == btn1){
    trace('btn1');
    delete btn1.onRollOver;
    delete btn1.onRelease;
    delete btn1.onRollOut;        
    
    btn2.onRollOver = function(){
        
    btn2.colorTo(0xFA6000,0.2, "linear");
    }
    
    btn2.onRollOut = function(){
        btn2.colorTo(null, 1.2);
        
    }
    btn2.onRelease = function(){
        
        var curent_page = btn2;
        page_checker()
        trace('btn2released');
        btn2.colorTo(0xFA6000,0.2, "linear");                        
    }
}

if (current_page == btn2){
    trace('btn2page');
    delete btn2.onRollOver;
    delete btn2.onRelease;
    delete btn2.onRollOut;            
    
    btn1.onRollOver = function(){
    
    btn1.colorTo(0xFA6000,0.2, "linear");
    }
    
    btn1.onRollOut = function(){
        btn1.colorTo(null, 1.2);
        
    }
    btn1.onRelease = function(){
        
        var curent_page = btn1;
        page_checker()
        trace('btn1');
        btn1.colorTo(0xFA6000,0.2, "linear");            
        
    }

}

```

}
