Skip intro button needs to disappear when next layer is shown
I have a little card game that plays an animation at the beginning and has a "skip Intro" button. When a player clicks button it moves him to the main page to start the game. That works fine unless the player does not push the button. The animation finishes and it goes to main page but the "skip intro" button is still visible on the main page and wont disappear until it is clicked. I was wondering if there was a way to put this button on a timer so that visible status changes to false after set amount of time. Below is the code
public function document() {
super();
trace(" constructor code");
targetMC = this;
targetMC.mainscreen.visible = true;
targetMC.mainscreen.playMC.addEventListener(MouseEvent.CLICK , mainscreenButtonHandler);
targetMC.mainscreen.rulesMC.addEventListener(MouseEvent.CLICK , mainscreenButtonHandler);
targetMC.helpscreen.returntogame.addEventListener(MouseEvent.CLICK , mainscreenButtonHandler);
targetMC.help_btn.addEventListener(MouseEvent.CLICK , mainscreenButtonHandler);
targetMC.helpscreen.visible = false;
targetMC.animSkip.addEventListener(MouseEvent.CLICK , mainscreenButtonHandler);
init();
}
private function mainscreenButtonHandler(evt:MouseEvent):void {
var btnName:String = evt.currentTarget.name;
switch(btnName) {
case "animSkip":
targetMC.animSkip.removeEventListener(MouseEvent.CLICK , mainscreenButtonHandler);
targetMC.animSkip.visible = false;
targetMC.mainanimation.stop();
targetMC.mainanimation.visible = false;
targetMC.mainscreen.visible = true;