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

Error #1009 Null Object Reference

New Here ,
Sep 23, 2013 Sep 23, 2013

The information can be found in the image below please let me know if you can't read it. The reference to "Awsome Game Folder" in the output screen can be attributed to the following Box2D zipped file downloaded from the following address if you want to follow along. its http://sourceforge.net/projects/bpx2dflash/  Line # 21 on this image should be world.clearforces();

Problem.jpg

Additionally the same problem occurs with this code which is the next code in the process

Problem 2 .jpg

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

Community Expert , Sep 23, 2013 Sep 23, 2013

if you want to hire me, send an email via my website:  http://www.kglad.com>contact.

to solve the problem in your first code snippet, delete line 14.

Translate
Community Expert ,
Sep 23, 2013 Sep 23, 2013

world is null in your first code snippet.

that's because you defined two different variables to have the name world.  one, that's global to your Main class and one that's local to your Main constructor.

that's an error.  you certainly wouldn't want two same named variables referencing different objects.

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
New Here ,
Sep 23, 2013 Sep 23, 2013

Sir, So how do I fix it?  I am copying this straight from a text book so I don't get why its wrong.

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
New Here ,
Sep 23, 2013 Sep 23, 2013

Whats your phone number?

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 Expert ,
Sep 23, 2013 Sep 23, 2013

if you want to hire me, send an email via my website:  http://www.kglad.com>contact.

to solve the problem in your first code snippet, delete line 14.

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
New Here ,
Sep 23, 2013 Sep 23, 2013
LATEST

and the second one code snippet?

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