KeyboardEvent.KEY_DOWN Arrow Keys

I have a very strange problem. I'm listening to both KEY_DOWN
and KEY UP events. Both handlers work just fine for everything,
well almost everything. KEY_DOWN Events aren't getting fired for
UP, DOWN, LEFT, and RIGHT. Every other key appears to be working
just fine with my KEY_DOWN handler and my KEY_UP handler. Very,
very odd.
I'm happy to post snippets of code, but this stuff isn't
rocket science. I have a hunch this is a bug, but I couldn't find
anything in the bug system like this. I have a Logitech Internet
350 Keyboard, model number Y-US76A, if you need to know.

I just tried my app on another macine, a laptop with a
separate number pad. Same issue. I have no clue what's happening.
There are enough examples on the web for me to believe this should
be working.
BTW - This is an AIR application

Similar Messages

  • Control Using Arrow Keys

    Hope someone can help. I am new to Flash CS4 - still learning - and this has had me stumped for days! Deadline is still the same though...
    I am redesigning a powerpoint presentation which contains a lot of graphs etc (29 slides total) and I want to animate this in Flash. I have everything drawn up in Illustrator and I'm now at the stage of bringing this all over to Flash.
    Once I have everything in Flash and animated, what I want to do is allow the presenter (my client) to control playback using the arrow keys (aka powerpoint). My intention is to have labels at the various stages of the graph where the animation will stop (using stop();) and then when the presenter presses the right arrow key the presentation will continue to play. I also need the left arrow key to go back to the previous label in case they advance too far or they have to go back to review something.
    I also wondered what best practice would be when creating something like this. Should I create separate Flash files for each 'slide' and load them (don't really know how to do this) or use separate movie clips for each slide within the one Flash file? My lack of knowledge leaves me wanting to build everything along the one timeline but I guess this would get too complicated...
    Apologies if this has been answered elsewhere but after searching both the Adobe site and the web I cannot find a suitable solution.
    Thanks in advance.

    I'll try...
    I have a presentation that I am working on which contains a series of graphs, charts etc that I have animated. This is navigated through by using your earlier code for the arrow keys.
    Originally I had everything sitting on one timeline but this was getting too complicated to make the changes that I needed to do so I have spit each section into a separate file - now have 26 files plus the loader.
    I now need to be able to move backwards from one loaded movie to the previous one - ie a section loads - the presenter moves through it using the arrow keys, but if they have to go back they can simply keep pressing the arrow key to get to the start of that section and then when they press it again it will load up the previous .swf file (hope this is making sense).
    Code I have in my loader file:
    var ldr:Loader=new Loader ();
    addChild(ldr);
    loadNext("sections/01title.swf");
    function loadNext(swfName:String) {
    ldr.unloadAndStop();
    ldr.load(new URLRequest(swfName));
    Code I have in each section at the start to use the arrow keys:
    stop();
    // create an array to hold the names of the frame labels
    var labels:Array = new Array();
    // take the name of each label in a MovieClip and put each
    // one into the array...
    for (var l:* in this.currentLabels) {
        labels.push(this.currentLabels[l].name);
    // add an event listener to the stage to listen for key strokes
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
    // the function that interprets key strokes
    function keyDownHandler(event:KeyboardEvent):void {
        // find out where you are in the movieClip...
        var thisOne:* =labels.indexOf(currentLabel);
        // use the left or right arrow key press...
        switch (event.keyCode) {
            case 37 :// left arrow key
                if (thisOne!=0) {
                    gotoAndPlay(labels[thisOne -1]);
                break;
            case 39 :// right arrow key
                if (thisOne!=labels.length-1) {
                    gotoAndPlay(labels[thisOne + 1]);
                break;
    And at the end of each section I have the following code to load up the next movie:
    MovieClip(this.parent.parent).loadNext("sections/08woodmanagement.swf");
    I see that you have replied to my new post about this - do you want me to reply to that and stop using this thread?

  • How to make a first-person style game with arrow key movement?

    Hey guys, I've made some simple click-to-move 1st person games with AS3, but I just wanted to know if there was a way to move around in 1st person with arrow keys, I was thinking you could get the background to move with the arrow keys, but that would be a little confusing.
    If you guys have any suggestions for me, or if it's possible, please reply! Thanks

    Here is a basic switch usage to move something with the keyboard:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, move_mc);
    function move_mc(event:KeyboardEvent):void {
        switch(event.keyCode)
           case  Keyboard.LEFT : mc.x -= 5
           break;
           case  Keyboard.RIGHT : mc.x += 5
           break;
           case Keyboard.UP : mc.y -= 5
           break;
           case Keyboard.DOWN : mc.y += 5
           break;

  • Movement with arrow keys

    When I first put this code in, it worked.  Now it doesn't.  Does anyone have any ideas as to how to fix it?
    var playerMc:player = new player();
    addChild(playerMc);
    playerMc.x=520;
    playerMc.y=390;
    var speed:Number = 10;
    var left:uint = 37;
    var up:uint = 38;
    var right:uint = 39;
    var down:uint = 40;
    import flash.events.KeyboardEvent;
    stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownListener);
    function keyDownListener(e:KeyboardEvent) {
        if (e.keyCode==left){
      playerMc.x = playerMc.x - 10
    if (e.keyCode==up){
      playerMc.y = playerMc.y - 10;
    if (e.keyCode==right){
      playerMc.x = playerMc.x + 10;
    if (e.keyCode==down){
      playerMc.y = playerMc.y + 10;

    That's the thing, it did work and now it doesn't.  This is all the code I have for the scene.  I don't think any of it is interferring.  But nothing happens when
    I hit the arrow keys.  And this was my third mover code I tried and this one finally worked.
    //variables
    var doorslocked:Boolean = true;
    //end variables
    //vendor count
    var vendorcount = 0;
    if (vendorcount == 7){
    gotoAndStop (8);
    //end vendor count
    // timer
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    var secs:Number = 0;
    var mins:Number = 9;
    var sec_t:String;
    var min_t:String;
    var my_timer:Timer = new Timer(1000);
    my_timer.addEventListener(TimerEvent.TIMER, timerHandler);
    my_timer.start();
    function timerHandler(event:TimerEvent):void
    if (secs == 0 || secs <= 0) {
      if (mins == 0) {
       my_timer.stop();
       trace("Countdown is finished.");
       return;
       gotoAndStop (9);
      } else {
       --mins;
       secs = 59;
    } else {
      --secs;
    sec_t = (secs<10) ? "0"+String(secs) : String(secs);
    min_t = (mins<10) ? String(mins)+":" : String(mins)+":";
    time.text = String(min_t+sec_t);
    //end timer
    //mover
    var playerMc:player = new player();
    addChild(playerMc);
    playerMc.x=520;
    playerMc.y=390;
    var speed:Number = 10;
    //end mover
    //test keys
    var left:uint = 37;
    var up:uint = 38;
    var right:uint = 39;
    var down:uint = 40;
    import flash.events.KeyboardEvent;
    stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownListener);
    function keyDownListener(e:KeyboardEvent) {
        if (e.keyCode==left){
      playerMc.x = playerMc.x - 10
    if (e.keyCode==up){
      playerMc.y = playerMc.y - 10;
    if (e.keyCode==right){
      playerMc.x = playerMc.x + 10;
    if (e.keyCode==down){
      playerMc.y = playerMc.y + 10;
    //end testing
    //vendors
    var vendor_local:Number = Math.random()*3;
    var vendor_floral:Number = Math.random()*3;
    var vendor_music:Number = Math.random()*3;
    var vendor_decor:Number = Math.random()*3;
    var vendor_cake:Number = Math.random()*3;
    var vendor_photo:Number = Math.random()*3;
    var vendor_video:Number = Math.random()*3;
    //end vendors

  • Moving Sprite with arrow keys, simultaneous directions

    Hi everyone.
    I'm trying to create a small arcade style game, you control a
    small ship, shoot at incoming targets, try to dogde their shots,
    etc. I'm working on the ship's movement right now, using the arrow
    keys to control it. Getting it to move one direction at a time is
    easy, but sometimes I need to move it diagonally, otherwise I think
    gameplay will suffer considerably.
    I have tried several things but I never seem to be able to
    tell Flash that two keys are being pressed simultaneously. Can
    anyone tell me how I might achieve this?
    Thank you.

    This format should allow detection of multiple keys at once:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
    function keyPressed(ev:KeyboardEvent):void {
    var pressedKey:uint = ev.keyCode;
    if(pressedKey == Keyboard.LEFT) {
    leftDown = true;
    if(pressedKey == Keyboard.RIGHT) {
    rightDown = true;
    if(pressedKey == Keyboard.UP) {
    upDown = true;
    if(pressedKey == Keyboard.DOWN) {
    downDown = true;
    ship.addEventListener(Event.EnterFrame, moveShip);
    }

  • Problem with scrolling text through arrow keys after exporting file to html

    I am using Fash Professional CS6. I have created a text box that I can scroll through the scroll wheel of my mouse, as the scroll bar is hidden. But when I try to scroll the text through the arrow keys it is not allowing me to so that. As this is website and everyone is not going to have a scroll wheel, I have to make the arrow keys work to scroll the text. Could you please help me in fixing this problem? I tried to search this problem, but I haven't seen any questions so far.

    if tf is your textfield:
    stage.addEventListener(KeyboardEvent.KEY_DOWN,f);
    function f(e:KeyboardEvent):void{
        if(e.keyCode==38){
            tf.scrollV++;
        } else if(e.keyCode==40){
            tf.scrollV--;

  • IOS KeyboardEvent.KEY_DOWN not fired

    This is basically this issue:
    http://python.mmitd.com/bugs.adobe.com/jira/browse/SDK-30339
    The KeyboardEvent.KEY_DOWN or KEY_UP does not get fired on iOS.
    A "fix" is posted explaining you to listen for the Event.CHANGE instead which is all fine and dandy, but how then do I check for the ENTER key press. Rememer on the Event.CHANGE I don't get a keyCode.

    Depending on which TextArea and your customization, KEY_DOWN may get
    aggregated and applied later.  CHANGE event is when the text changed.

  • Bridge CC crashes while using arrow keys to switch images

    Adobe Photoshop CC 2014 Adobe Bridge 2014 on Mac is crashing every time I press an arrow key to move through images in bridge. I can click to manually select images with no problem, but using the up/down arrow keys to move to the next image up/down brings up the spinning beach ball and immediately locks the program up, requiring a force quit.
    Did the usual Mac permissions and fsck stuff to no avail. Ideas?
    Dan

    Thanks for moving my post to this correct forum. (I'm afraid I missed it when I originally posted.) A bit more information based on attempts to fix and on further attempts to use the program.
    After launching Bridge — before I select any specific image — it initially seems to work correctly. For example, I can use menu items and select and open folders. However...
    Once I drill down through folders to show raw files in the browser the problems begin. I can manually select an image by clicking on it, but the program the locks up if I do things such as attempt to navigate to another image using the up/down keyboard arrows or select anything from a menu that would perform an action on the image. (The problem happens with any image selected — not one particular image, and with images that worked fine until 48 hours ago.)
    ACR still works. I can double click an image and open the raw converter, and I can doubly click a smart object image in Photoshop do go back to the raw editor and it allows me to edit.
    I did the step of holding down command-option-shift at Bridge startup and selecting all three options to delete the cache and so forth. Still no joy.
    I did the usual Mac disk/file system repair stuff — repairing permissions and repairing disk — to no avail.
    I downloaded and reinstalled Bridge but the problem persists.
    Since I have a full backup of the drive on which Bridge is installed and since this backup drive is bootable, I double clicked the copy of Bridge on the backup drive... and it opened (slowly!) but worked correctly. (Not that this means much, but my second instance on my laptop continues to run fine.)
    I'm stuck, in a serious way, at this point. Thoughts?
    Thanks,
    Dan

  • Arrow key and space bar do not work scrolling in PDF document with film file?

    I have made a single PDF file from 26 different InDesign files, first exported to PDF:s. Text and photos. One of the documents contain a film file (.mov). As I scroll through the documents in full screen mode, once I start to play and stop the film I can no longer use the spacebar nor right arrow key to get to the next document. Only mouse works.
    Adobe 11.0.10 MBP with Yosemite.
    Many thanks for input!
    /Ivar

    Hi Melfour-
    Here is a Support article detailing how to work with your Firefox PDF preferences:
    [[Opening PDF files within Firefox]]
    Hope that helps.

  • Some of the shortcut keys and directional keys on the keyboard are not working in FF 4 RC1 (i.e. Tab, Ctrl+C, arrow keys). They work fin in FF 3.6x and other applications.

    Crtl+C, Ctrl+V, Ctrl+X, Tab, and arrow keys do not work at all in FF4.0b13 and later. I am not sure about earlier versions as this is the first version I have tried.

    I found this helpful article (http://support.apple.com/kb/TS1381) and worked my way through the section "Some keys don't work as expected".
    All the following functions/settings are disabled or turned off:
    Text to speech / Speak selected text when the key is pressed
    Slow Keys
    Mouse Keys.
    The keyboard viewer just confirms my list of keys that are not working.
    Starting in safe mode makes no difference; nor does booting from the Mac OS X Install Disc and running Terminal from the Utilities menu. The same keys as before fail to work.
    This seems to confirm that it's a hardware issue. Anyone have any suggestions?

  • Up/Down Arrow keys do not perform their function on SOME websites or at SOME times, on other websites and at other times these keys work fine, updated firefox, restarted computer. turned off cursor key option in Advanced tab, using autoscrolling option.

    Up/Down Arrow keys do not perform their function on SOME websites or at SOME times, on other websites and at other times these keys work fine, updated firefox, restarted computer. turned off cursor key option in Advanced tab, using autoscrolling option.

    You may have switched on [http://kb.mozillazine.org/accessibility.browsewithcaret caret browsing].
    You can press press F7 (on Mac: fn + F7) to toggle caret browsing on/off.
    See http://kb.mozillazine.org/Scrolling_with_arrow_keys_no_longer_works
    * Tools > Options > Advanced : General: Accessibility: [ ] "Always use the cursor keys to navigate within pages"

  • Arrow keys - up, down, left right - not working in Safari 2.0.4 (419.3)

    Hello all - need some help as my arrows keys in Safari have ceased working - can't scroll up or down using them and wondering why. Yes, they do work in all other app's, Yes I have deleted pref files for Safari, done most common maintenace and yes I have searched extensively for any help online.
    I did install the beta for Safari 3, and then promptly uninstalled, leaving me as I am and have been for a few days without working arrow keys.
    Any help out there is most appreciated

    hmmmm...no help, no replies.....
    ......thanks everyone!
    Hi Michael.
    I read your question when you first posted and had absolutely no idea why this problem would occur. So I didn't respond.
    I'd guess that's the same with everyone else who came across your question. People aren't ignoring you purposefully - they just don't know the answer or have any ideas to troubleshoot this problem.
    Of course, that could change. You only posted two days ago, and there's a chance that in this user-to-user forum, where all people who help are volunteering their time, anyone who happens to have an idea of why this problem is occurring just hasn't come across your question yet.

  • How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys?

    How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys an see at the same time the changes on the photo?
    It worked under Windows, now I use OS 10.8 and have to apply a preset with a click or Return button but after that the pop-up menu close so I have to open it once again to change a preset. Please help. Thank you!

    The filter panel is a shortcut for the content panel and it only effects the content of that window. So if you have a folder it will only see this as a folder and not with its content. (a Stack behaves about the same, being different in only counting the first file in the filter panel criteria but not what is in the stack itself)
    You have a view work arounds, first is use menu view / show items from subfolders (this can take some time especially if you have not used caching before on this content) and this builds visible thumbs for all content and that can be used for filtering.
    Or use the find command (Edit / find) and inhere specify the source and fill in the criteria include subfolders and this will give you the correct result.
    When you create a smart collection the find command also pops up given you the same opportunity to get the results in a collection, but since a collection is only a bunch of aliases referring to the originals you might be a bit careful with editing and deleting.

  • How do I get Firefox to go back to scrolling one line at a time with the up/down arrow keys? I noticed this changed in Firefox 10 and I actually preferred the one line at a time, can this be an option in future releases?

    The title says it all, I'm not really sure if this is the proper place to post this as it's not a "bug" per se. I noticed on the list of bugs "fixed" in Firefox 10 scrolling more than one line with the arrow keys was one of them. I know a lot of people hated the one-line thing too so I'd suggest in future releases it should be a preference we can change.

    You can right-click either Back or Forward button to open the tab history list.

  • In Dreamweaver CC code view, how do I reenable shift-control+arrow keys to select words?

    In previous versions of Dreamweaver (for Windows but presumably for other operating systems as well) and in pretty much any other text editor (except maybe for vi/m but including the one I'm using to write this message in now). I can select characters using shift plus the arrow keys and select words by pressing shift-control plus the arrow keys. It seems you now have to use shift-alt to select words. I don't want to have to undo about 25 years of habit just for Dreamweaver.
    Please say this is an easy setting I can uncheck somewhere! Thanks!

    That is an issue that has come up a lot lately...
    Make sure to add your voice to the others here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform and hopefully in the next release they'll put it back to normal.

Maybe you are looking for