Skip to main content
Known Participant
February 20, 2013
Answered

Cannot access a property or method of a null object reference

  • February 20, 2013
  • 5 replies
  • 875 views

Hi guys i am trying to connect "scene 1" to "scene 2"

Then this ERROR comes out >>>  Cannot access a property or method of a null object reference.

You guys can check my Flash File at >>> http://www.filedropper.com/run

Please help. When I only run the Scene 2 it plays but when i tried to connect it with scene 1. An ERROR comes out.

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Colin Holgate

Did you also put in the stop() line in the first scene? I can run your movie, and have the egg running and jumping, without any errors. But I saw errors until I put the stop(); line in.

5 replies

Colin Holgate
Inspiring
February 20, 2013

Your frame 1, scene 1 script should be this:

Play_btn.addEventListener(MouseEvent.CLICK, mouseDownHandler);

function mouseDownHandler(evt:MouseEvent):void {

gotoAndStop(1, 'Scene 2');

}

stop();

Known Participant
February 20, 2013

Wooops sorry about that. I changed it now to 'Scene2' but still the annoying error of death is still there >>>

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

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

Colin Holgate
Colin HolgateCorrect answer
Inspiring
February 20, 2013

Did you also put in the stop() line in the first scene? I can run your movie, and have the egg running and jumping, without any errors. But I saw errors until I put the stop(); line in.