Actionscript 3 As3错误1009无法找到

Actionscript 3 As3错误1009无法找到,actionscript-3,flash,Actionscript 3,Flash,我们已经看了几个小时的代码,但无法找出错误:X 请有人帮我弄清楚我快疯了 我仍然有一个很大的问题,我转到第1帧,我看到背景上的第3帧仍在运行。。。当游戏重新启动飞船和其他东西时,idk如何重新启动:/ /* Código que pára a timeline na 1 frame para que o menu continue apresentado*/ stop(); import flash.text.Font; Font.registerFont(space); /*Moviment

我们已经看了几个小时的代码,但无法找出错误:X 请有人帮我弄清楚我快疯了

我仍然有一个很大的问题,我转到第1帧,我看到背景上的第3帧仍在运行。。。当游戏重新启动飞船和其他东西时,idk如何重新启动:/

/* Código que pára a timeline na 1 frame para que o menu continue apresentado*/
stop();

import flash.text.Font;
Font.registerFont(space);
/*Movimenta a nave fazendo a seguir os movimentos do rato e esconde o cursor do sistema operacional*/
addEventListener( Event.ENTER_FRAME, gameLoop );
// create the array for the bullets
var bullets:Array = [];
// create the array for the enemies
var enemies:Array = [];
var pontos=0;
var toma:TOMA = new TOMA();

stage.addChild(arma_tiro);
arma_tiro.mouseEnabled = false;
arma_tiro.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);

function fl_CustomMouseCursor(event:Event)
{
    arma_tiro.x = stage.mouseX;
}
Mouse.hide();


/* Mouse Click Event
Clicking on the specified symbol instance executes a function in which you can add your own custom code.

Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is clicked.
*/

stage.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);

function fl_MouseClickHandler_3( event:MouseEvent ):void
{
    toma.play();
    // create the bullet
    var bullet:bullet_ = new bullet_();
    addChild(bullet);
    bullet.x=arma_tiro.x;
    bullet.y=arma_tiro.y;

    // add the bullet to the bullets array
    bullets.push(bullet);
    bullet.addEventListener(Event.ENTER_FRAME, moverbala);

}

function moverbala(event:Event):void // função para mover a bala para cima */
{
    event.target.y=event.target.y-20;
}

//stage.addEventListener(Event.ENTER_FRAME, Primeira);

setInterval(Primeira, 1500) ; //define intervalo de tempo entre as varias repetiçoes da funçao
function Primeira():void
{
    var invader1:invader_1 = new invader_1();
    addChild(invader1);
    invader1.x=0;
    invader1.y=120;

    enemies.push( invader1 );
    invader1.addEventListener(Event.ENTER_FRAME, mover1);
} 

function mover1(event:Event):void  
{
    event.target.x+= -9;
}

//Nave 2

setInterval(Segunda, 750) ; //define intervalo de tempo entre as varias repetiçoes da funçao
function Segunda():void
{
    var invader2:invader_2 = new invader_2();
    addChild(invader2);
    invader2.x=0;
    invader2.y=85;

    enemies.push( invader2 );
    invader2.addEventListener(Event.ENTER_FRAME, mover2);
} 

function mover2(event:Event):void // função para mover a nave para lado direito */
{
    event.target.x+=-5;
}

//Nave 3

setInterval(Terceira, 1000) ; //define intervalo de tempo entre as varias repetiçoes da funçao
function Terceira():void
{
    var invader3:invader_3 = new invader_3();
    addChild(invader3);
    invader3.x=0;
    invader3.y=45;

    enemies.push( invader3 );
    invader3.addEventListener(Event.ENTER_FRAME, mover3);
} 

function mover3(event:Event):void // função para mover a nave para lado direito */
{
    event.target.x+=-3;
}

//bonus
setInterval(bonus, 7500) ; //define intervalo de tempo entre as varias repetiçoes da funçao
function bonus():void
{
    var bonus:bonus_1 = new bonus_1();
    addChild(bonus);
    bonus.x=0;
    bonus.y=15;

    enemies.push(bonus);
    bonus.addEventListener(Event.ENTER_FRAME, mover4);
} 

function mover4(event:Event):void // função para mover a nave para lado direito */
{
    event.target.x+=-5;
}

function gameLoop(event:Event):void
{
    var firstLoop:Boolean = true;

    // loop to move/remove the bullets
    for( var a:int = bullets.length-1; a>=0; a-- )
    {
        bullets[a].y -= 20;
        // if the bullet is not on screen anymore, remove it from array
        if( bullets[j].y < 0 )
        { 
            removeChild( bullets[a] );
            bullets.splice(a,1);
            continue;
        }
    }

    // loop enemies
    for( var i:int = enemies.length-1; i>=0; i-- )
    {
        // move the enemy
        enemies[i].x += 10;
        // loop the bullets to see if on collide the enemy
        for( var j:int = bullets.length-1; j>=0; j-- )
        {
            // test collision with the enemy
            if( enemies[i].hitTestObject( bullets[j] ))
            {
                // make your enemy dead
                removeChild( enemies[i] );
                pontos++;
                // remove it from the array
                enemies.splice(i,1);
                pontox.text = String(pontos);

            }
        }
    }

}

/* Countdown Timer
Counts down from a specified number of seconds.

Instructions:
1. To change the length of the countdown, change the value 10 in the first line below to the number of seconds you want.
*/


pontoss.text= "pontos";
tempos.text = "tempo";
var fl_SecondsToCountDown:Number = 30;

var fl_CountDownTimerInstance:Timer = new Timer(1000, fl_SecondsToCountDown);
fl_CountDownTimerInstance.addEventListener(TimerEvent.TIMER, fl_CountDownTimerHandler);
fl_CountDownTimerInstance.start();


function fl_CountDownTimerHandler(event:TimerEvent):void
        {
    if (fl_SecondsToCountDown >1)
        {
            tempo.text = String(fl_SecondsToCountDown);
            fl_SecondsToCountDown--;
        };

    if (fl_SecondsToCountDown == 2)
        {
            stop();
            gotoAndStop(1);
        };

        }

你不打算停止计时吗

所以,也许你的意思是fl_倒数计时;而不是停下来


是的,我已经解决了这个问题,但我仍然有一个巨大的问题,我转到第1帧,我看到背景上的第3帧仍在运行。。。当游戏重新启动飞船和其他东西时,idk如何重新启动:/
//.. 
if (fl_SecondsToCountDown == 2)
        {
            fl_CountDownTimerInstance.stop();
            gotoAndStop(1);
        };

        }
//..