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