# Simple navigation problem

**URL:** <https://forum.kirupa.com/t/simple-navigation-problem/320163>\
**Category:** Uncategorized\
**Created:** [March 15, 2011, 5:40pm UTC](https://forum.kirupa.com/t/simple-navigation-problem/320163 "2011-03-15T17:40:22Z")\
**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 15, 2011, 5:40pm UTC](https://forum.kirupa.com/t/simple-navigation-problem/320163/1 "2011-03-15T17:40:22Z")

</div>

Hi there

Im trying to make a simple navigation, all it needs to do is onRollOver change the color of the movie clips background and delete the current page rollover. Im sure im just making a stupid mistake. Any help would be appreciated. see code below:

var currentPage = “ibuy”;

function deleteMouseEvents()  
{  
delete nav.ibuy\_button.onRollOver;  
delete nav.icool\_button.onRollOver;  
}

deleteMouseEvents()  
checkPage()

function checkPage()  
{  
if( currentPage == “ibuy”)  
{

```
        var colorful = new Color("_root.nav.ibuy_button.filler");
        colorful.setRGB(0x8CC042);    
        nav.ibuy_button.ibuy_txt.textColor = 0xffffff;    
        
        nav.icool_button.onRelease = function()
        {                            
        currentPage = "icool";
        checkPage();
        deleteMouseEvents()
        }            

}        

if( currentPage == "icool")
{    
                    
        var colorful = new Color("_root.nav.icool_button.filler");
        colorful.setRGB(0xEB7D31);    
        nav.icool_button.icool_txt.textColor = 0xffffff;    

        nav.ibuy_button.onRelease = function()            
        {
            
            checkPage();                    
            deleteMouseEvents()        
        }            

}

```

}  
checkPage();
