# One button stops working

**URL:** <https://forum.kirupa.com/t/one-button-stops-working/298296>\
**Category:** flash\
**Created:** [October 16, 2009, 5:11am UTC](https://forum.kirupa.com/t/one-button-stops-working/298296 "2009-10-16T05:11:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![n01d3a](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@n01d3a](https://forum.kirupa.com/u/n01d3a)\
**Post date:** [October 16, 2009, 5:11am UTC](https://forum.kirupa.com/t/one-button-stops-working/298296/1 "2009-10-16T05:11:12Z")

</div>

I am creating a flash website, I have some movie clips that hold the contents. (ie I have a movie clip to hold my navigation buttons and another to hold the actual content.) I wrote some action script on a separate layer that is outside of the movie clips, the AS adds event listeners and a few simple functions. All my navigational buttons work prefectly, I have a button that I use for email, this works the first the frame is loaded. If I go to another frame (another page of the website), and then go back, the button no longer works, I tested with just using trace(“the email button was clicked”);

oh, I thought I might add that each page of the website is a different frame, that is inside my content movie clip.

my AS looks like this:

stop();

navigation\_mc.home\_btn.addEventListener(MouseEvent.CLICK, homeClickF);  
navigation\_mc.rates\_btn.addEventListener(MouseEvent.CLICK, ratesClickF);  
navigation\_mc.services\_btn.addEventListener(MouseEvent.CLICK, servicesClickF);  
navigation\_mc.gallery\_btn.addEventListener(MouseEvent.CLICK, galleryClickF);  
content\_mc.email\_btn.addEventListener(MouseEvent.CLICK, openMailClientF);

function homeClickF(e:MouseEvent):void{  
content\_mc.gotoAndStop(“home”);  
}

function ratesClickF(e:MouseEvent):void{  
content\_mc.gotoAndStop(“rates”);  
}

function servicesClickF(e:MouseEvent):void{  
content\_mc.gotoAndStop(“services”);  
}

function galleryClickF(e:MouseEvent):void{  
content\_mc.gotoAndStop(“gallery”);  
}

function openMailClientF(e:MouseEvent):void{  
trace(“You clicked the email button!”);  
}

thanks for any help in advance

idea:  
ok so I just thought of something, when I click to change the page(frames), the button disappears. and when I go back I am thinking that the addListenerEvent is no longer on the button, so how can I get around this?

once again thanks for the help
