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
Actionscript 3 错误1009 Actionscript Flash CC_Actionscript 3_Flash_Timer_Movieclip - Fatal编程技术网

Actionscript 3 错误1009 Actionscript Flash CC

Actionscript 3 错误1009 Actionscript Flash CC,actionscript-3,flash,timer,movieclip,Actionscript 3,Flash,Timer,Movieclip,所以在过去的两个小时里,我一直在试图找出这个错误,我试图在整个互联网上寻找答案,但到目前为止我还没有找到答案 有人能帮我吗!这是我的代码: stop(); countdown_mc.visible = false; stage.focus = stage; import flash.utils.Timer; import flash.events.TimerEvent; import flash.sensors.Accelerometer; import flash.events.Acceler

所以在过去的两个小时里,我一直在试图找出这个错误,我试图在整个互联网上寻找答案,但到目前为止我还没有找到答案

有人能帮我吗!这是我的代码:

stop();
countdown_mc.visible = false;
stage.focus = stage;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.sensors.Accelerometer;
import flash.events.AccelerometerEvent;



var myAccel: Accelerometer = new Accelerometer();
var score: Number = 0;
var countDown: Timer = new Timer(1000);

stage.addEventListener(Event.ENTER_FRAME, checkHit);
myAccel.setRequestedUpdateInterval(100); //Every half second.




countDown.addEventListener(TimerEvent.TIMER, count);


countDown.start();

if (Accelerometer.isSupported == true) {
    myAccel.addEventListener(AccelerometerEvent.UPDATE, update);

    function update(e: AccelerometerEvent) {

        x_mc.x -= (e.accelerationX * 30);
        o_mc.x -= (e.accelerationX * 30);


        if (x_mc.x < 150) {
            x_mc.x = 150;
        }
        if (x_mc.x >= stage.stageWidth - 150) {
            x_mc.x = stage.stageWidth - 150;
        }

        if (o_mc.x < 150) {
            o_mc.x = 150;
        }
        if (o_mc.x >= stage.stageWidth - 150) {
            o_mc.x = stage.stageWidth - 150;
        }



    }
}




function count(eeee: TimerEvent) {

    var drop: Number = Math.floor(Math.random() * 5) + 1;




    if (drop == 1) {
        x_mc.gotoAndPlay(2);
        countDown.stop();
        gotoAndPlay(180);
        o_mc.stop();
        stage.removeEventListener(Event.ENTER_FRAME, checkHit);
        stage.removeEventListener(AccelerometerEvent.UPDATE, update);
        stage.removeEventListener(TimerEvent.TIMER, count);

    } else if (drop == 2) {
        o_mc.gotoAndPlay(2);
        countDown.stop();
        gotoAndPlay(180);
        x_mc.stop();
        stage.removeEventListener(Event.ENTER_FRAME, checkHit);
        stage.removeEventListener(AccelerometerEvent.UPDATE, update);
        stage.removeEventListener(TimerEvent.TIMER, count);

    } else if (drop) {

        x_mc.stop();
        o_mc.stop();

    } else if (x_mc.hitTestObject(exoHit_mc)) {
        score++;

    }







}


function checkHit(eeee: Event) {
    if (x_mc.hitTestObject(exeHit_mc)) {
        gotoAndStop(257);
        stage.removeEventListener(Event.ENTER_FRAME, checkHit);
        stage.removeEventListener(AccelerometerEvent.UPDATE, update);
        stage.removeEventListener(TimerEvent.TIMER, count);



    }
}
我发现这与x_mc和o_mc的电影剪辑有关,但我不知道问题是什么,因为我对动作脚本还不熟悉


非常感谢你

x_mc
o_mc
在帧上不存在,或者没有设置实例名称。验证两个对象都设置了正确的实例名称。完成此操作后,还要验证
exoHit_mc
exeHit_mc
的这一点。

只是一个猜测:脚本引用的一个对象在第179帧不存在(不存在)。检查您的时间表。
[SWF] flash%20gmae.swf - 2013164 bytes after decompression
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashgmae_fla::MainTimeline/count()[flashgmae_fla.MainTimeline::frame179:91]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashgmae_fla::MainTimeline/count()[flashgmae_fla.MainTimeline::frame179:91]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashgmae_fla::MainTimeline/count()[flashgmae_fla.MainTimeline::frame179:79]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashgmae_fla::MainTimeline/count()[flashgmae_fla.MainTimeline::frame179:91]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashgmae_fla::MainTimeline/count()[flashgmae_fla.MainTimeline::frame179:79]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashgmae_fla::MainTimeline/count()[flashgmae_fla.MainTimeline::frame179:67]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
[UnloadSWF] flash%20gmae.swf
Test Movie terminated.