Skip to main content
Trace_Log_Flash_Win_7
Participating Frequently
September 26, 2014
Question

Help With TypeError: Error #1009

  • September 26, 2014
  • 1 reply
  • 448 views

I know what TypeError: Error #1009 is, but I can't seem to figure out what exactly the problem is with my code.

My Code:

MoreWhite.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_53);

function fl_ClickToGoToAndPlayFromFrame_53(event:MouseEvent):void

{

    fl_TimerInstance_27.stop();

    gotoAndPlay(82, "Scene 15");

    GreenCircleWhite.visible = true;

    MoreWhite.removeEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_53); <----------------------- This line is where the error occurs when I run the program.

    MoreBlack.removeEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_54);

    this.stop();

   

    var fl_SecondsToCountDown_5:Number = 2;

    var fl_CountDownTimerInstance_5:Timer = new Timer(1000, fl_SecondsToCountDown_5);

    fl_CountDownTimerInstance_5.addEventListener(TimerEvent.TIMER, fl_CountDownTimerHandler_5);

    fl_CountDownTimerInstance_5.start();

   

    function fl_CountDownTimerHandler_5(event:TimerEvent):void

    {

        trace(fl_SecondsToCountDown_5 + " seconds");

        fl_SecondsToCountDown_5--;

       

        if(fl_SecondsToCountDown_5 == 0)

        {

            BlueCircleBlack.visible = true;

            trace("Trial Number: 7" + "\nTrial Type: Disagreement" + "\nInitial Choice: 0");

            gotoAndPlay(82, "Scene 15");

        }

    }

}

This code is just a duplicate of another code that are on different scenes.

All my scenes have the same code, but with different numbers added onto each variable to make it different.

All those other scenes work just fine, but it's this particular set of code that doesn't work at all.

Any ideas on what the problem is? I'll provide extra information if it helps coming up with a solution.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
September 27, 2014

If the line you point to is where the error occurs then it means that when that line executes there is no MoreWhite object present, at least not by that name.  Try moving the lines that remove the listeners before the lines where you change to other frames.