Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Keep getting Error #1009 Please help

New Here ,
Jul 19, 2015 Jul 19, 2015

"TypeError: Error #1009: Cannot access a property or method of a null object reference.

  at TheUnseen_fla::MainTimeline/frameHandlers02()[TheUnseen_fla.MainTimeline::frame825:16]"

my code:

next.visible = false

var myStrings:String = "Well done, we now know the cause of death. A bullet to the heart. so we know that a gun was used in the murder. now all we need to do is have a look at these suspects we got in yesterday. I'll leave them in your care. Have Fun. ";

var myArrays:Array = myStrings.split("")

addEventListener(Event.ENTER_FRAME, frameHandlers02);

function frameHandlers02(event:Event):void {

  if (myArrays.length > 0) {

  textbox.appendText(myArrays.shift());

  } else {

   removeEventListener(Event.ENTER_FRAME, frameHandlers02);

  next.visible = true

  }

}

the scene will run perfectly by itself but when I play the whole document it gives that error, I have double checked naming and objects but still cannot find what is causing it.

TOPICS
ActionScript
189
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 19, 2015 Jul 19, 2015
LATEST

If that is the beginning of the error message you see then the error is in line 16 of frame 825

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

 

- is declared but not instantiated

- doesn't have an instance name (or the instance name is mispelled)

- does not exist in the frame where that code is trying to talk to it

- is animated into place but is not assigned instance names in every keyframe for it

- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines