Flash 4 help

6 posts

Flag Post

I am trying to make a game on flash 4, but I do knot know how the get keyboard buttons to work, any help?

 
Flag Post

You mean Adobe Flash CS4? And what do you mean by keyboard buttons not working? Is it not typing in text boxes or are the hotkeys not working?

 
Flag Post

Flash CS4?

AS2: http://www.flash-creations.com/notes/asclass_key.php (or the shootorials)
AS3: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d01.html

 
Flag Post

getting the keyboard to interact with games, eg up button makes a character jump.

 
Flag Post

If you are working with AS3, add an EventListener to the stage to listen for KeyboardEvents:


stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
// This means, every time a key is held down, the ‘keyDownHandler’ function will be called, which I will write now:

private function keyDownHandler(e:KeyboardEvent):void
{
// The variable ‘e’ now holds information about the event. e.keyCode will hold the code of the key that was pressed.
if(e.keyCode == 38)
{
// Put code here to be executed when the UP arrow is pressed.
}
}

 
Flag Post

I think he is a copy paste noob maq. He wont understand that.
I would suggest This Website for him.