Skip to main content
Participant
August 31, 2011
Question

Error #1009 Simple Help please

  • August 31, 2011
  • 2 replies
  • 435 views

Hello there guys, I been working on a small project on flash CS5.5 AS3, it is a side scrolling platform game.

However I been coming up with an error which is this :

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

at Corestructure_Scene1_fla::MainTimeline/movingPlayer()[Corestructure_Scene1_fla.MainTimeline::frame4:83]

And the line it points at is this one :

Velocity +=  gravity;

if (!floor.hitTestPoint(larry.x,larry.y,true))

{

larry.y +=  Velocity;

}

if (Velocity > 20)

{

Velocity = 20;

}

Now I dont know what to do, this error keep coming up as soon as i start the game, i move the character left and right, its fine, I press jump and the characters jumps fine, however, as soon as the character lands, this error keeps coming up and I just dont know how to fix it.

Any help would be great!

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
August 31, 2011

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 not in the display list
- 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).
Participating Frequently
August 31, 2011

Does floor exist?