Skip to main content
Known Participant
July 11, 2015
Question

TypeError: Error #1009: Cannot access a property or method of a null object reference. at KKK25_fla::MainTimeline/qwe()[KKK25_fla.MainTimeline::frame4:50]

  • July 11, 2015
  • 7 replies
  • 488 views

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

  at KKK25_fla::MainTimeline/qwe()[KKK25_fla.MainTimeline::frame4:50]

This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

kglad
Community Expert
Community Expert
July 11, 2015

on line 50 of frame 4 of your main swf you're trying to reference (with actionscript) an object that doesn't exist (when your code executes).

Debugging ActionScript 3.0 Errors | Adobe Community

Known Participant
July 12, 2015

whats the best thing i would do?

here's the code

function qwe(e:Event){

  mcGdeJesus.y += 25 / stage.frameRate;

  mcMDizon.y += 28 / stage.frameRate;

  mcMAquino.y += 30 / stage.frameRate;

  mcTMagbanua.y += 42 / stage.frameRate;

  mcTTecson.y += 34 / stage.frameRate;

  mcJRizal.y += 36 / stage.frameRate;

  if(mcGdeJesus.y > stage.stageHeight + mcGdeJesus.height){

  mcGdeJesus.x = Math.random() * 450 + 450;

  mcGdeJesus.y = -mcGdeJesus.height

  }

  if(mcMDizon.y > stage.stageHeight + mcGdeJesus.height){

  mcMDizon.x = Math.random() * 450 + 450;

  mcMDizon.y = -mcMDizon.height

  }

  if(mcMAquino.y > stage.stageHeight + mcGdeJesus.height){

  mcMAquino.x = Math.random() * 450 + 450;

  mcMAquino.y = -mcMAquino.height

  }

  if(mcTMagbanua.y > stage.stageHeight + mcGdeJesus.height){

  mcTMagbanua.x = Math.random() * 450 + 450;

  mcTMagbanua.y = -mcTMagbanua.height

  }

  if(mcTTecson.y > stage.stageHeight + mcGdeJesus.height){

  mcTTecson.x = Math.random() * 450 + 450;

  mcTTecson.y = -mcTTecson.height

  }

  if(mcJRizal.y > stage.stageHeight + mcGdeJesus.height){

  mcJRizal.x = Math.random() * 450 + 450;

  mcJRizal.y = -mcJRizal.height

  }

  }

and when i click the button play, it goes error and here's the code for the button.

mcPlay.addEventListener(MouseEvent.CLICK, GameWOFMenu);

function GameWOFMenu(m:MouseEvent)

{

  gotoAndStop(1, "GameMenu");

}

kglad
Community Expert
Community Expert
July 12, 2015

which is line 50 of frame 4?