6.5.11

Game Doesn't Work!

As was written in my previous post, my Game didn't work. There were two compiler errors:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at PlaneGame/movelevel()

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at PlaneGame/movelevel()

From just looking at these two errors, I have discerned that the cause of the problem is the "null object reference", which I assume means the the Actionscript file is calling objects that were not even instantiated yet or added to the Display list- one or the other.

Well, looking back at the code, I can see that the main variables in the game- na aircraft and na stage- have already been instantiated, and therefore the problem must be that the objects were not added to the display list before they were worked on. So that's my answer.

No comments:

Post a Comment