Skip to main content
Participant
July 9, 2013
Question

The "A" key only registers on the first KEY_DOWN instance on no subsequent instances

  • July 9, 2013
  • 1 reply
  • 802 views

Here you go, the most primitive code in the entire world:

private function init()

                    {

                              trace('balls');

                              stage.addEventListener(KeyboardEvent.KEY_DOWN, kDown);

                              stage.addEventListener(KeyboardEvent.KEY_UP, kUp);

                    }

 

                    private function kDown(e:KeyboardEvent)

                    {

                              var targ = e.keyCode;

                              trace(targ);

                    }

 

                    private function kUp(e:KeyboardEvent)

                    {

                              var  targ = e.keyCode;

                              trace(targ);

                    }

all keys trace but my "A" key, the "A" key traces the first time and never again.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 9, 2013

there's no problem with that code.  the problem is elsewhere.

Participant
July 9, 2013

I sort of figured, right now this is all i got running though, there is no 'elsewhere' except the app itself which is where I think the problem is...

Unfortunately I talked to a few people at Adobe and all of them referred me here... just posted the code to follow protocol.

kglad
Community Expert
Community Expert
July 9, 2013

create a new fla, copy that code and paste it into frame 1, remove "private" x 3, call init().

test.

any problem?