# Calling a button from another location

**URL:** <https://forum.kirupa.com/t/calling-a-button-from-another-location/245156>\
**Category:** flash\
**Created:** [November 27, 2007, 12:59am UTC](https://forum.kirupa.com/t/calling-a-button-from-another-location/245156 "2007-11-27T00:59:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![function4](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@function4](https://forum.kirupa.com/u/function4)\
**Post date:** [November 27, 2007, 12:59am UTC](https://forum.kirupa.com/t/calling-a-button-from-another-location/245156/1 "2007-11-27T00:59:06Z")

</div>

I have a nav bar with buttons that change pages and such, but I also want another button that goes to the same pages.  
The button loads a random image and then I want it to call the appropriate button it is in the nav bar.

```php
var rand = random(4);

if (rand == 0) {
loadMovie("bioBtn.jpg", this.holder);
_parent._parent.nav_mc.whereTo = "bio";
}
if (rand == 1) {
loadMovie("eventsBtn.png", this.holder);    
_parent._parent.nav_mc.whereTo = "events";
}

if (rand == 2) {
loadMovie("forumBtn.png", this.holder);    
_parent._parent.nav_mc.whereTo = "forum";
}

if (rand == 3) {
loadMovie("mediaBtn.jpg", this.holder);
_parent._parent.nav_mc.whereTo = "media";
}

btn.onPress = function(){
    _parent._parent.nav_mc.whereTo.go();
    }

```

How do I call the button functions from this location? I get undefined whenever I try to call something from those nav bars? ahhhhhhh!
