user3601206
user3601206

Reputation: 26

Actionscript3 - Cannot access a property or method of a null object reference

I want build a game, but i get this errors:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at project.game.players.controllers::myPlayerController/onEnterFrame()

This is my class: http://pastebin.com/x0kpaDg2

What is the problem?

Upvotes: 0

Views: 39

Answers (2)

Crabar
Crabar

Reputation: 1857

Your array clicked is not initialized. And for associative arrays preferable to use Object type.

Upvotes: 2

Ingweland
Ingweland

Reputation: 1079

The problem is that some of your object is not instantiated. Thus, it is null. And thus, you have this exception because you are trying to access it. This is kind of problem which reasons is not that hard to find. Just debug your app.

Upvotes: 0

Related Questions