Skip to main content
Participant
November 10, 2014
Answered

ERROR 1119

  • November 10, 2014
  • 2 replies
  • 514 views

I have these script on my flash file, but still got that errors. I'm on my school project, and I'm not into ActionScript nor Flash before. Please help me.

Scene 1, Layer 'action', Frame 1, Line 23

1119: Access of possibly undefined property Q through a reference with static type Class.

Scene 1, Layer 'action', Frame 1, Line 24

1119: Access of possibly undefined property W through a reference with static type Class.

Scene 1, Layer 'action', Frame 1, Line 251119: Access of possibly undefined property E through a reference with static type Class.

stop();

fscommand("fullscreen","true")

var kanan:Boolean = false;

var kiri:Boolean = false;

var lompat:Boolean = false;

var jongkok:Boolean = false;

var dance:Boolean = false;

var blower:Boolean = false;

var balon:Boolean = false;

var jumlah:int = 0;

pipi.addEventListener (Event.ENTER_FRAME,bergerak);

stage.addEventListener (KeyboardEvent.KEY_DOWN, tekantombol);

stage.addEventListener (KeyboardEvent.KEY_UP, lepastombol);

function tekantombol (event:KeyboardEvent):void{

  switch (event.keyCode){

  case Keyboard.RIGHT :{kanan = true;break;}

  case Keyboard.LEFT :{kiri = true;break;}

  case Keyboard.UP :{lompat = true;break;}

  case Keyboard.DOWN :{jongkok = true;break;}

  case Keyboard.Q :{dance = true;break;}

  case Keyboard.W :{blower = true;break;}

  case Keyboard.E :{balon = true;break;}

  }

}

function lepastombol (event:KeyboardEvent):void{

  switch (event.keyCode){

  case Keyboard.RIGHT :{kanan = false;break;}

  case Keyboard.LEFT :{kiri = false;break;}

  case Keyboard.UP :{lompat = false;break;}

  case Keyboard.DOWN :{jongkok = false;break;}

  case Keyboard.Q :{dance = false;break;}

  case Keyboard.W :{blower = false;break;}

  case Keyboard.E :{balon = false;break;}

  }

}

function bergerak (event:Event){

  pipi.x+=jumlah;

  if(pipi.x>=850){pipi.x=-8;}

  if(pipi.x<=-150){pipi.x=820;}

  if (kanan){pipi.gotoAndStop(3); jumlah=4;}

  if (kiri){pipi.gotoAndStop(2); jumlah=-4;}

  if (lompat){pipi.gotoAndStop(4); jumlah=0;}

  if (jongkok){pipi.gotoAndStop(5); jumlah=0;}

  if (dance){pipi.gotoAndStop(6); jumlah=0;}

  if (blower){pipi.gotoAndStop(7); jumlah=0;}

  if (balon){pipi.gotoAndStop(8); jumlah=0;}

}

I have these script on my flash file, but still got that errors. I on my school project, and I'm not into ActionScript nor Flash before. Please help me.

This topic has been closed for replies.
Correct answer Ned Murphy

Try using the integer value instead of the constant....

replace Keyboard.Q with 81

replace Keyboard.W with 87

replace Keyboard.E with 69

2 replies

kglad
Community Expert
Community Expert
November 10, 2014

i don't see any problems with the code you showed.

double check frame 1 line 23 in your action layer.

Ned Murphy
Ned MurphyCorrect answer
Legend
November 10, 2014

Try using the integer value instead of the constant....

replace Keyboard.Q with 81

replace Keyboard.W with 87

replace Keyboard.E with 69

Participant
November 10, 2014

Thanks a lot! It worked.

Ned Murphy
Legend
November 10, 2014

You're welcome