Source Files – http://www.developphp.com/video/Flash/Capture-Keyboard-Input-to-Make-User-Keyboard-a-Control-Interface
ActionScript 3.0 CS3 + CS4 tutorial and source files for learning how to capture keyboard input and program flash games that operate on the keyboard.
source
my ship not move to the left..the code is right..:(
@bcapecci probably because you have to use a key code, not the actual key letter.
Interesting
if you set the "registration point" of theShip exactly on the nose (so the nose tip was on x:0 and y:0), you wouldnt have to guess the x and y value to use for the laserShot.
Also, a tip for centering things –> laserShot.x = (theShip.width/2)-(laserShot.width/2); Great intro to actionscript – nice and easy pace.
the listener code won't log most my keys. just the numbers, arrows and a few of the keys to the right of the keyboard. help anyone??
awesome 5 stars. Thank you so much for this tutorial, REALLY really helped me a LOT
"at the: var KeyCharCode:uint=event.charCod e;
it says: Access of undefined property event" Looks like you have a space in the second charCode variable…just my guess
haha what are you talking about?
I am unable to get to the search box you used to access the code samples.
Peace
Joe
you have cs4 right
i have cs4 and when i click help it opens in a browser and there are no codes! what to do?
I got to say thank you for providing this video, well conducted, very easy to follow through, you explain the purposes of the code very well and it is going to help me greatly in class, thank you once again.
Not sure what you mean, I programmed it in using the A key… D key… Space key or any other key I want… what are you talking about?
I proved it to you in the video, every bit of my programming is on screen for you to see… explain further please cuz that does not make sense to me.
Very true… good note man!
great tut, very helpful thanx 😀
as a side note, you can improve the code by combining the if conditionals with && and also just put -=, not -=+ (+= not +=+)
if (keycharcode==97 && theShip.x>leftBounds) {theShip.x-=shipSpeed;}
great tutorial, not finished it yet but it is great, at 20:28 atm but I have a problem :(.
I checked for errors just like you said, but I have a syntax error at 'var laserBlaster.laser = new laser();
Syntax Error: Expecting semicolon before dot
what do i do?
btw great tut!