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

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

Community Beginner ,
May 01, 2018 May 01, 2018

TinyUpload.com - best file hosting solution, with no limits, totaly free

Click on the rocket = bring you to space, click again anywhere on stage use up down left right arrow keys to move, touch the saturn planet, tada... Errors

can someone look into my codes and tell me what is wrong that triggered all those bunch of errors? Thank you

TOPICS
ActionScript
858
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

correct answers 1 Correct answer

LEGEND , May 01, 2018 May 01, 2018

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
Community Beginner ,
May 01, 2018 May 01, 2018

File download link = first sentence

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 ,
May 01, 2018 May 01, 2018

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).

 

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

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
Community Beginner ,
May 01, 2018 May 01, 2018

I'm still a beginner at this and i don't exactly know when do i need to instantiate something or not, hence i've provided the link above to my file so you guys could look at my codes to better assist me, i've read your point 2,3,4, i don't think mine falls under those, I don't understand your point 5. Seems really foreign to me.

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 ,
May 01, 2018 May 01, 2018

If someone is willing to access your file they will be along and probably do so.  I anticipate someone will based on other postings of late so keep your hopes up.

The error boils down to an object not existing when code is trying to target it.

The 5th point involves a bit of a quirk of objects in the timeline... having an object in the timeline, where there are two keyframes that contain that same object that are right next to each other.  If the one in the first frame is without an instance name, then the one in the adjacent frame inherits that lack of an instance name despite whether or not you assigned it an instance name in that second frame.  So if there were any code in the latter frame trying to target that object using its instance name, you would get the 1009 error due to it not finding an object having that instance name.

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
Community Beginner ,
May 01, 2018 May 01, 2018

For that particular scene, i've only got 1 keyframe, everything is inside.

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 ,
May 02, 2018 May 02, 2018
LATEST

The error boils down to an object not existing when code is trying to target it.

If you follow the instructions I provided earlier it should help by identifying the line(s) of code where the problem erupts.

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