Copy link to clipboard
Copied
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 25 | 1119: 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.
Try using the integer value instead of the constant....
replace Keyboard.Q with 81
replace Keyboard.W with 87
replace Keyboard.E with 69
Copy link to clipboard
Copied
Try using the integer value instead of the constant....
replace Keyboard.Q with 81
replace Keyboard.W with 87
replace Keyboard.E with 69
Copy link to clipboard
Copied
Thanks a lot! It worked.
Copy link to clipboard
Copied
You're welcome
Copy link to clipboard
Copied
i don't see any problems with the code you showed.
double check frame 1 line 23 in your action layer.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now