Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 无法移动框架_Actionscript 3_Flash_Timer - Fatal编程技术网

Actionscript 3 无法移动框架

Actionscript 3 无法移动框架,actionscript-3,flash,timer,Actionscript 3,Flash,Timer,我做了一个捕手游戏,遇到了麻烦,当时间用完时无法移动画面 我已经做了: function addMc() { var NewMc = new MC(); NewMc.y = Math.ceil(Math.random() * 500); NewMc.x = 50; addChildAt(NewMc,1); pelotas.push(NewMc); NewMc.addEventListener(Event.ENTER_FRAME, dropMc);

我做了一个捕手游戏,遇到了麻烦,当时间用完时无法移动画面

我已经做了:

function addMc()
{
    var NewMc = new MC();
    NewMc.y = Math.ceil(Math.random() * 500);
    NewMc.x = 50;
    addChildAt(NewMc,1);
    pelotas.push(NewMc);
    NewMc.addEventListener(Event.ENTER_FRAME, dropMc);
}

function dropMc(e:Event)
{
    var b:MC = MC(e.target);
    b.x +=  10;
    if (b.x > 900)
    {
        eliminasiMC(b);
    }
}

stage.addEventListener(Event.ENTER_FRAME, catcher);

function catcher(e:Event)
{
    catcherMC.y = mouseY;
    for (var i:int=0; i<pelotas.length; i++)
    {
        if (catcher.hitTestObject(pelotas[i]))
        {
            eliminasiMC(pelotas[i]);
            point++;
            txtPoint.text = String(point);
        }
    }
}

function eliminasiMC(B)
{
    B.removeEventListener(Event.ENTER_FRAME, dropMc);
    removeChild(B);
}

var tTime:Number = 5;
var timer:Timer = new Timer(1000,tTime);
timer.addEventListener(TimerEvent.TIMER, countdown);
timer.start();
function countdown(event:TimerEvent)
{
    txtTime.text=String((tTime)-timer.currentCount);
    if (txtTime.text == "0")
    {
        stage.removeEventListener(Event.ENTER_FRAME, catcher);
        timer.stop();
        timer.removeEventListener(TimerEvent.TIMER, countdown);
        gotoAndStop("nextFrame"); // HERE MY PROBLEM
    }
}

addBabi()
函数的第80帧的第18行中有一个
null
对象。尝试验证该帧或放入该帧的代码。Post
eliminasiMC()
函数。此外,您永远不会清除pelotas上已消除的对象,这最终会使您的游戏陷入困境。请将第80帧的代码添加到问题中,为此,请按问题下方的“编辑”并添加更多文本。
TypeError: Error #1009: Cannot access a property or method of a null object reference.  at GEBUGENDE_fla::MainTimeline/addBabi()[GEBUGENDE_fla.MainTimeline::frame80:18]    at Function/http://adobe.com/AS3/2006/builtin::apply()  at SetIntervalTimer/onTimer()   at flash.utils::Timer/_timerDispatch()  at flash.utils::Timer/tick()