help with making a back button
hi
in a game im making i have a start menu that then when you click play goes to the game after playing the game, when you die a game over screen appears with a play again button in it i want to put a back button to go to the first frame.
the way this is set up is that the game over menue is a movie clip with the play again button in it i want to have a back movie clip to make it go to the first frame
gotoAndStop(1) dosent seem to work or mabye i am doing it wrong
this my game class file as the game over menu does not have a class file:
package com.alienattack{
import flash.display.MovieClip;
import flash.events.Event;
import flash.utils.Timer;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.Stage;
public class Game extends MovieClip {
static var ship:MovieClip;
static var enemyShipTimer:Timer;
static var scoreText:TextField;
static var score:Number;
static var healthMeter:HealthMeter;
static var enemyHealthMeter:EnemyHealthMeter;
static var gameOverMenu:GameOverMenu;
static var powerUpTimer:Timer;
static var miniBossTimer:Timer;
static var RocketShipTimer:Timer;
var bossCountdown:Number;
static var Bombtimer:Timer;
private var _stage:Stage;
static var backgroundMusic = new BackgroundMusic();
var Bullet;
public function Game(){
this.addEventListener(Event.ADDED_TO_STAGE,init);
}
function init(e:Event):void{
_stage=stage;
KeyClass.initialize(stage);
stage.focus = this;
ship = new Ship();
ship.x = 300;
ship.y = 150;
_stage.addChild(ship);
enemyShipTimer = new Timer(2000);
enemyShipTimer.addEventListener("timer", sendEnemy);
enemyShipTimer.start();
RocketShipTimer = new Timer(3500);
RocketShipTimer.addEventListener("timer", sendEnemyRocket);
RocketShipTimer.start();
resetScore();
gameOverMenu = new GameOverMenu();
gameOverMenu.x = 0;
gameOverMenu.y = 0;
addChild(gameOverMenu);
gameOverMenu.visible = false;
gameOverMenu.playAgainButton.addEventListener("mouseDown", newGame); (this is where i think the play again button is but how would i make it so it when to the first frame)
backgroundMusic.play(0,1000);
}
static function gameOver()
{
gameOverMenu.visible = true;
enemyShipTimer.stop();
miniBossTimer.stop();
RocketShipTimer.stop();
Bombtimer.stop();
powerUpTimer.stop();
for (var i in EnemyShip.list)
{
EnemyShip.list.kill();
}
}
function newGame(e:Event)
{
gameOverMenu.visible = false;
ship.visible = true;
ship.x = 300;
ship.y = 150;
ship.takeDamage(-ship.maxHealth);
ship.addEventListener("enterFrame", ship.move);
resetScore();
enemyShipTimer.start();
miniBossTimer.start();
RocketShipTimer.start();
Bombtimer.start();
powerUpTimer.start();
}
