Multiple Keypresses in FL 1.1

Hi guys,
How do you capture simultaneous multiple keypresses in FL
1.1? I used a key catcher (button) to catch all events like:
quote:
on(keyPress "1"){call("moveUp1")}
on(keyPress "7"){call("moveDown1")}
on(keyPress "3"){call("moveUp2")}
on(keyPress "9"){call("moveDown2")}
There are 2 objects on the stage and I want them to move up
and down independently. In most cases, users get to press 2 keys at
the same time. When this happens, the object stops moving.
Please help! Thanks!
Jon

I think Flash Lite only responds to 1 key press, and ignores
any subsequent key press, until the user releases the first
key.

Similar Messages

  • Multiple KeyPress - Ctrl + A to start an event

    Hi All,
    PL HELP....
    The application require multiple keypress to trigger an
    event, for example, press CTRL + A to go to other frame.
    I have used the following function, It does not work out.
    _root.onEnterFrame=function()
    someListener = new Object();
    someListener.onKeyDown = function () {
    if (Key.isDown(65) and Key.isDown(66)) {
    gotoAndPlay("v1");
    Key.addListener(someListener);
    Thanks in advance
    Sonum

    ok the issue here seems to be that this is within an
    onEnterFrame event - this is not needed, it's continually tell the
    timeline to play the label over and over - as a result, does
    nothing.

  • Listening for multiple keypresses simultaneously

    I'm trying to move a rectangle around with arrow keys.
    The current code of keyPressed method is
         public void keyPressed(KeyEvent e){
    /*           switch(e.getKeyCode()){
                   case 37: x=(Math.max(0,x-3));break;
                   case 38: y=Math.max(0,y-3); break;
                   case 39: x=Math.min(200,x+3);break;
                   case 40: y=Math.min(200,y+3);break;
              int a = e.getKeyCode();
              if(a == 37){x=Math.max(0,x-3);}
              if(a == 38){y=Math.max(0,y-3);}
              if(a == 39){x=Math.min(200,x+3);}
              if(a == 40){y=Math.min(200,y+3);}
              repaint();
         }The problem is that when pressing multiple keys at the same time only one registers.
    So how do I register multiple key presses ad change x and y accordingly?
    thank you

    It seems to me that the problems mentioned in that link with the "hold" could be solved with using a state flag set on keyPressed and then reset on keyReleased. When you release even one you should get the keyReleased event and until then, you should be in a hold state.

  • Multiple keyPress + tween scripts

    I am doing a flashlite project (AS2) for an embedded application and am having trouble figuring something out. I want a single instance of a menu button that I can move with keyboard cursor presses to specific locations on the Y axis. Figuring out that part was easy but I am stumped on adding multiple commands to the same button.
    The initial script I am working with is:
    on (keyPress "<Down>") {
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var xPosT:Tween = new Tween(high, "_y", regular.easeOut, -234.8, -186.8, 6, false);
    Then I wanted to add something to the effect of:
    on (keyPress "<Down>") {
    if (y == "-186.8") {
    var xPosT:Tween = new Tween(high, "_y", regular.easeOut, -186.8, -135, 6, false);
    To tell it that if the button is at -186.8 go to -135.6. So obviously I am having trouble using keyPress "<Down>" twice. What would be the best way to approach this? I would like to have numerous keyPress "<Down>" and keyPress "<Up

    You are right your code works fine. This is what I have:
    on (keyPress "<Down>") {
    import mx.transitions.Tween;
    import mx.transitions.easing.*;   
         var finalY = -186.8; // some default value
         if (high._y == -234.8) {
              finalY = -186.8;
         } else if(high._y == -186.8) {
              finalY = -135;
    } else if(high.y == -135) {
      finaly = -86.2;
    } else if(high.y == -86.2) {
      finaly = -38;
    } else if(high.y == -38) {
      finaly = 10;
    } else if(high.y == 10) {
      finaly = 58.2;
    } else if(high.y == 58.2) {
      finaly = 106.2;
    } else if(high.y == 106.2) {
      finaly = 156.2;
    } else if(high.y == 156.2) {
      finaly = 206.2;
    } else if(high.y == 206.2) {
      finaly = 255.2;
         var xPosT:Tween = new Tween(high, "_y", regular.easeOut, high._y, finalY, 6, false);
    I had to put the import commands inside the on handler to make it work. The only problem I am having now is with the line:
    var finalY = -186.8; // some default value
    In your example you had that set to 0. On the first keyPress <"Down"> the button went directly to 0 on the Y axis. I tried putting the value for the first stop on the Y axis, -186.8 and I am having trouble understanding whats happening. On the first keyPress <"Down"> the button goes to -186.8, the second goes to -135 but the third goes back up to -186.8. If I change the value to something higher like the final stop, 255.2 then on the first keyPress <"Down"> it goes directly to 255.2. I have attached the CS4 fla and swf for you to see.

  • Starting HAL causes multiple keypresses

    Whenever I start HAL either from an already running system or at boot it causes every keyboard press to register multiple times. I think it might be related to hotplugging and possibly since I have the keyboard and such configured manually through xorg.conf
    Here is an example of me typing abc:   aaabbbccc

    Hi bostonvaulter,
    There is something in the wiki related to that problem.  It might be the solution you are looking for.
    Ciao.

  • Handling multiple keypresses

    Hi,
    I'm trying to code a small race game for 2 players (using the same keyboard). My problem: if the players press too many keys the computer gives a small beep and the game stops for a split-second, which is annoying. How to get rid of that? (To see what I mean: press 6 or seven keys simultaniously for a few seconds...)
    Thanks a lot,
    Adriaan
    PS: The applet looks like this:
    public class Game extends Applet implements KeyListener{
    addKeyListener(this);
    public void keyTyped(KeyEvent e){ }
    public void keyPressed(KeyEvent e){
    public void keyReleased(KeyEvent e){
    }

    yeah, i get this same problems... ie, when i hold down one button and keep this button down, then press another button, the application is suppose to detect both keypresses, but doesn't.
    in jdk1.0, using the keydown() method worked, but that has been deprecated in jdk1.2. WHY???

  • Multiple keypress using applescript

    Hi there.
    I would like to be apple to have a script to quickly press three keyboard key (q,w,e) when I hold them down. I'm playing a videogame slowly breaking my hand... :-(. I tried to write it in applescript, but I'm really a newbie. Could someone help me. I don't mind the script to be in function outsite the game application (it would then be a "simple" multiple key hold repetition). I would really appreciate help...
    Max

    Be careful what you ask for:
    The literal answer to your question looks like:
    tell application "System Events"
      key down "q"
      key down "w"
      key down "e"
    end tell
    However, that only addresses half the problem. This will run indefinitely, and I'm assuming at some point you want to let go of the keys, too? You don't specify that part of the equation. How do you intend to signal the keys to be released.
    Ultimately the script should include corresponding 'key up' commands to release the keys. You just need to work out the mechanics of how to do that.

  • KeyEventDispatcher Seeing Incorrect Number Of Keypresses

    Greetings,
    I have a Swing/AWT drawing application (running on OS X) that has a label option. When the user selects the label option, they are allowed to click once on my canvas panel (which resides in an internal frame in a desktop pane) and then type their text. My label class that implements the KeyEventDispatcher correctly gains access to the keyboard input stream through:
    DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
    and performs work upon the key events through the dispatchKeyEvent function.
    The problem is that when the user types their text, multiple keypresses are received for only one keystroke. Sometimes 6 of the same character are captured, sometimes 3. The keycode for the character, even though it remains the same, can sometimes change. The following is a capture of a user typing "Greetings, this is a test!!!". I have captured the result of each event's getID(), getWhen(), hashCode(), getKeyChar(), and getKeyCode() and copied the output below. As you can see, this is quite wacky behavior. I have totally removed my keyListener, since the focus subsystem was changed. I thought perhaps multiple listerners were picking up the same keypress, but that would not explain two identical keyChars with different keyCodes? I am running the application on Mac OS X. A plethora of thanks in advance for any morsel of assistance.
    K7
    ID: 401 When: 4711705034502649969 Hash: 13285460 : Capturing keypress - ? - 16
    ID: 401 When: 4711705043532228152 Hash: 11958058 : Capturing keypress - G - 71
    ID: 400 When: 4711705043532228152 Hash: 4400085 : Capturing keypress - G - 0
    ID: 402 When: 4711705046111624448 Hash: 13842387 : Capturing keypress - G - 71
    Drawing in GP's paint
    ID: 402 When: 4711705048995974160 Hash: 3482471 : Capturing keypress - ? - 16
    ID: 401 When: 4711705078944770377 Hash: 6835750 : Capturing keypress - r - 82
    ID: 400 When: 4711705078944770377 Hash: 15961328 : Capturing keypress - r - 0
    Drawing in GP's paint
    ID: 402 When: 4711705082492273778 Hash: 6372179 : Capturing keypress - r - 82
    ID: 401 When: 4711705089250275969 Hash: 10754076 : Capturing keypress - e - 69
    ID: 400 When: 4711705089250275969 Hash: 4113117 : Capturing keypress - e - 0
    Drawing in GP's paint
    ID: 402 When: 4711705091518985069 Hash: 3289716 : Capturing keypress - e - 69
    ID: 401 When: 4711705095060432565 Hash: 10498262 : Capturing keypress - e - 69
    ID: 400 When: 4711705095060432565 Hash: 15002459 : Capturing keypress - e - 0
    Drawing in GP's paint
    ID: 402 When: 4711705097629585365 Hash: 10740767 : Capturing keypress - e - 69
    ID: 401 When: 4711705100858348505 Hash: 15796839 : Capturing keypress - t - 84
    ID: 400 When: 4711705100858348505 Hash: 1704781 : Capturing keypress - t - 0
    Drawing in GP's paint
    ID: 402 When: 4711705103747368994 Hash: 13010541 : Capturing keypress - t - 84
    ID: 401 When: 4711705105032219198 Hash: 14365489 : Capturing keypress - i - 73
    ID: 400 When: 4711705105032219198 Hash: 12751864 : Capturing keypress - i - 0
    Drawing in GP's paint
    ID: 402 When: 4711705107618573341 Hash: 11777702 : Capturing keypress - i - 73
    ID: 401 When: 4711705110821083493 Hash: 12303100 : Capturing keypress - n - 78
    ID: 400 When: 4711705110821083493 Hash: 10194937 : Capturing keypress - n - 0
    Drawing in GP's paint
    ID: 401 When: 4711705113398804752 Hash: 14741677 : Capturing keypress - g - 71
    ID: 400 When: 4711705113398804752 Hash: 13592111 : Capturing keypress - g - 0
    ID: 402 When: 4711705114381471795 Hash: 11026476 : Capturing keypress - n - 78
    Drawing in GP's paint
    ID: 402 When: 4711705116308247812 Hash: 1134930 : Capturing keypress - g - 71
    ID: 401 When: 4711705120172816434 Hash: 11339833 : Capturing keypress - s - 83
    ID: 400 When: 4711705120172816434 Hash: 7806641 : Capturing keypress - s - 0
    Drawing in GP's paint
    ID: 402 When: 4711705123400903117 Hash: 4567087 : Capturing keypress - s - 83
    ID: 401 When: 4711705125972375198 Hash: 6649557 : Capturing keypress - , - 44
    ID: 400 When: 4711705125972375198 Hash: 14418506 : Capturing keypress - , - 0
    Drawing in GP's paint
    ID: 402 When: 4711705129178686397 Hash: 11604935 : Capturing keypress - , - 44
    ID: 401 When: 4711705131433093256 Hash: 13969258 : Capturing keypress - - 32
    ID: 400 When: 4711705131433093256 Hash: 1690810 : Capturing keypress - - 0
    Drawing in GP's paint
    ID: 402 When: 4711705134027049491 Hash: 6559246 : Capturing keypress - - 32
    ID: 401 When: 4711705137234584755 Hash: 2180223 : Capturing keypress - t - 84
    ID: 400 When: 4711705137234584755 Hash: 9052195 : Capturing keypress - t - 0
    Drawing in GP's paint
    ID: 402 When: 4711705139823483667 Hash: 2704300 : Capturing keypress - t - 84
    ID: 401 When: 4711705140446951857 Hash: 3614661 : Capturing keypress - h - 72
    ID: 400 When: 4711705140446951857 Hash: 14279289 : Capturing keypress - h - 0
    Drawing in GP's paint
    ID: 401 When: 4711705144633675240 Hash: 10526273 : Capturing keypress - i - 73
    ID: 400 When: 4711705144633675240 Hash: 3610207 : Capturing keypress - i - 0
    ID: 402 When: 4711705145287133039 Hash: 8820986 : Capturing keypress - h - 72
    Drawing in GP's paint
    ID: 402 When: 4711705148187137907 Hash: 15712776 : Capturing keypress - i - 73
    ID: 401 When: 4711705178769645812 Hash: 11067315 : Capturing keypress - s - 83
    ID: 400 When: 4711705178769645812 Hash: 15607307 : Capturing keypress - s - 0
    Drawing in GP's paint
    ID: 402 When: 4711705182000985932 Hash: 16754411 : Capturing keypress - s - 83
    ID: 401 When: 4711705190361096824 Hash: 1913382 : Capturing keypress - - 32
    ID: 400 When: 4711705190361096824 Hash: 5584739 : Capturing keypress - - 0
    Drawing in GP's paint
    ID: 402 When: 4711705194230014101 Hash: 3980107 : Capturing keypress - - 32
    ID: 401 When: 4711705198091780258 Hash: 272782 : Capturing keypress - i - 73
    ID: 400 When: 4711705198091780258 Hash: 12104635 : Capturing keypress - i - 0
    Drawing in GP's paint
    ID: 402 When: 4711705201643535677 Hash: 1690651 : Capturing keypress - i - 73
    ID: 401 When: 4711705204212076443 Hash: 10626673 : Capturing keypress - s - 83
    ID: 400 When: 4711705204212076443 Hash: 949406 : Capturing keypress - s - 0
    Drawing in GP's paint
    ID: 402 When: 4711705206480012449 Hash: 1646156 : Capturing keypress - s - 83
    ID: 401 When: 4711705208396802666 Hash: 10625254 : Capturing keypress - - 32
    ID: 400 When: 4711705208396802666 Hash: 13829853 : Capturing keypress - - 0
    Drawing in GP's paint
    ID: 402 When: 4711705211621217152 Hash: 3096997 : Capturing keypress - - 32
    ID: 401 When: 4711705215168978249 Hash: 403357 : Capturing keypress - a - 65
    ID: 400 When: 4711705215168978249 Hash: 9015524 : Capturing keypress - a - 0
    Drawing in GP's paint
    ID: 402 When: 4711705216457597287 Hash: 12469859 : Capturing keypress - a - 65
    ID: 401 When: 4711705218057032371 Hash: 4466342 : Capturing keypress - - 32
    ID: 400 When: 4711705218057032371 Hash: 14197152 : Capturing keypress - - 0
    Drawing in GP's paint
    ID: 402 When: 4711705222251390058 Hash: 5408640 : Capturing keypress - - 32
    ID: 401 When: 4711705224505442582 Hash: 5520561 : Capturing keypress - t - 84
    ID: 400 When: 4711705224505442582 Hash: 10564408 : Capturing keypress - t - 0
    Drawing in GP's paint
    ID: 402 When: 4711705230639428974 Hash: 5068142 : Capturing keypress - t - 84
    ID: 401 When: 4711705245772263059 Hash: 13506038 : Capturing keypress - e - 69
    ID: 400 When: 4711705245772263059 Hash: 12662230 : Capturing keypress - e - 0
    Drawing in GP's paint
    ID: 402 When: 4711705248019293311 Hash: 5443901 : Capturing keypress - e - 69
    ID: 401 When: 4711705252537996190 Hash: 949587 : Capturing keypress - s - 83
    ID: 400 When: 4711705252537996190 Hash: 3534544 : Capturing keypress - s - 0
    Drawing in GP's paint
    ID: 402 When: 4711705257027514768 Hash: 16000817 : Capturing keypress - s - 83
    ID: 401 When: 4711705259938697288 Hash: 12309474 : Capturing keypress - t - 84
    ID: 400 When: 4711705259938697288 Hash: 3120077 : Capturing keypress - t - 0
    Drawing in GP's paint
    ID: 402 When: 4711705262828845206 Hash: 14344544 : Capturing keypress - t - 84
    ID: 401 When: 4711705274110446540 Hash: 14662467 : Capturing keypress - ? - 16
    ID: 401 When: 4711705285696421468 Hash: 1973183 : Capturing keypress - ! - 49
    Drawing in GP's paint
    ID: 400 When: 4711705285696421468 Hash: 9826960 : Capturing keypress - ! - 0
    ID: 402 When: 4711705288924798061 Hash: 7714809 : Capturing keypress - ! - 49
    ID: 401 When: 4711705293100150518 Hash: 16772849 : Capturing keypress - ! - 49
    Drawing in GP's paint
    ID: 400 When: 4711705293100150518 Hash: 713167 : Capturing keypress - ! - 0
    ID: 402 When: 4711705295028021751 Hash: 4845633 : Capturing keypress - ! - 49
    ID: 401 When: 4711705299222927046 Hash: 9980573 : Capturing keypress - ! - 49
    Drawing in GP's paint
    ID: 400 When: 4711705299222927046 Hash: 3916193 : Capturing keypress - ! - 0
    ID: 402 When: 4711705300509516712 Hash: 914658 : Capturing keypress - ! - 49
    ID: 402 When: 4711705311779360573 Hash: 13999420 : Capturing keypress - ? - 16
    - 1001 When: 4711705324982906085 Hash: 15206241 : Capturing keypress -

    Try to use somethin like this. Only the Key released event is important for you.
    public boolean dispatchKeyEvent(KeyEvent e) {
    if( e.getID() == KeyEvent.KEY_RELEASED ) {
    System.out.println("event "+e.getKeyCode());

  • Ultra 10 Keyboard repeating keys after 2.5.1 install

    I have an Ultra 10 that I'm installing a special 2.5.1 jumpstart assisted install on. I get through the initial install sequence and the Ultra 10 reboots, when it comes up to the console login prompt, hitting any key yields multiple keypresses (1 quick press will yield 10-20 keypresses!). During the boot sequence, one of the status messages says " loadkeys: ioctl(KIOCLAYOUT): timer expired". I know this has something to do with the issue. I have a type 6 keyboard, as well as a type 5c keyboard, however I believe this version wants the plain old type 5 sun keyboard in order to function normally under this ancient OS. I can hit the stop-a command, and the keyboard functionality will work as I expect at the OK prompt, but attempting to use it under the kernel is impossible.
    I have attempted to log in via terminal, but this has not worked (I even have a manual describing how to do this, but no connection is ever made). I know new sun os's installed on this machine have normal keyboard functionality, and I also believe that there have been patches to address this issue.
    Questions:
    1. Does anyone know how to work around this w/o a type 5 keyboard.
    2. Is there a way to boot in separately and apply a patch to fix this / or make an adjustment so this does not occur?
    -Thanks in advance for any input on this one-

    Ouch !
    Haven't seen that one in years !
    It's your choice of that ancient Operating Environment, combined with a cpu faster than 419MHz.
    I hope you still have the extra OECD disk that was packed with that system when it was first shipped from Sun.
    Otherwise you may just be out of luck with using Solaris 2.5.1
    Here's a link at a non-Sun 3rd party web site to SRDB document *20576*
    http://www.sunshack.org/data/sh/2.1/infoserver.central/data/syshbk/collections/intsrdb/20576.html
    Perhaps MAAL and haroldb can contribute their thoughts on this.

  • I'd like to convert this OB action to a Pekwm action

    I found a thread by pablokal which showed his Openbox shortcuts and noticed one that I've really wanted:
    Super Left - resizes window to half the screen then snaps it to the left [Obkey options Action: unmaximizefull, maximizevert, move resize to x=0,y=0, width:half horizontal monitor resolution 1920:2=960]
    However, I use pekwm and not openbox. Does anyone know the commands to recreate this action in Pekwm syntax? I have tried, but my solution was clumsy and required multiple keypresses.
    Thanks for anyone who can help!

    If you had an actual table with tabular input you'd get something with an export to Excel.
    If the PDF was a well-formed Tagged PDF the export of tabular data into the spreadsheet file format would be rather good.
    But, alas, what you've displayed is not "spreadsheet" material.
    Export of form fields and form field content takes one down a somewhat different path.
    Be well...

  • Simultaneous ASDW key press undetected

    Hi guys, I'm currently developing a game that uses ASDW buttons for its movement system
    During one of my testing session, i realized that if i press 2 buttons simultaneously, (ex: A and S), both events would be dispatched one after the other (just like what i assume they would do)
    But if i press 3 buttons simultaneously, (ex: A, S and D), the last keypress (D) will go undetected
    Only after i release one of the keys (either A or S) will the last keypress be detected
    From what i read here ==> http://blog.nobien.net/2008/05/12/more-than-two-simultaneous-key-presses-and-keyboardevent key_down-woes/
    It is said that the problem might had been caused by a hardware issue
    From what i read at wikipedia http://en.wikipedia.org/wiki/Keyboard_%28computing%29
    [quote]
    Some low-quality keyboards suffer problems with rollover (that is, when multiple keys are pressed in  quick succession); some types of keyboard circuitry will register a  maximum number of keys at one time. This is undesirable for games (designed for multiple keypresses, e.g. casting a spell while holding  down keys to run) and undesirable for extremely fast typing (hitting new  keys before the fingers can release previous keys). A common side  effect of this shortcoming is called "phantom key blocking": on some  keyboards, pressing three keys simultaneously sometimes resulted in a  4th keypress being registered.
    Modern keyboards prevent this from happening by blocking the 3rd key  in certain key combinations, but while this prevents phantom input, it  also means that when two keys are depressed simultaneously, many of the  other keys on the keyboard will not respond until one of the two  depressed keys is lifted. With better keyboards designs, this seldom  happens in office programs, but it remains a problem in games even on  expensive keyboards, due to wildly different and/or configurable  key/command layouts in different games.
    [/quote]
    Question
    - What causes this problem is it a hardware issue or a language/flash player problem?
    Because i might be wrong, but i think i've played several non-flash games before that possess the ability to address multiple keypress at the same time
    - Can this problem be fixed?
    Code
    package
            import flash.display.Sprite;
            import flash.events.KeyboardEvent;
            public class Keyboard extends Sprite
                     public function Keyboard()
                            this.stage.addEventListener("keyDown", showKey);
                    public function showKey(event:KeyboardEvent)
                            trace(event.keyCode);
    Any help regarding the matter is greatly appreciated, thank you in advance~

    Quote
    do you think an update of the bios will do the trick?
    No, no, no, it won't, so please don't try it!
    Also, if you read the comments in the link you posted, your answer is there:
    Quote
    By Tony Fendall on May 12, 2008 | Reply
    The problem comes from the way in which the signal for the pressed keys moves from your keyboard to your computer. The signal is only 8-bit, and there are limits to how the signal can be changed to represent more than one key being pressed in combination.
    Long story short, the guys who designed the origional keyboards made a descision to support all two key combinations, and then selected as many three key combinations as they could support with the hardware. This meant that some combinations had to be left out, and they had to make a descision about which ones were more important.
    It just happens to be that they chose not to support three key combinations which involve the up arrow key. I do not think there is any solution to this problem…
    If you're playing games, why not just remap the keys in the game's settings?

  • Hot Key to Shut Down

    I used the quick shut down by pressing
    Control+Option+Command + Eject (Disc) to shut down my MacBook Air 13" and old MacBook Pro 15" (both in Core 2 Duo CPU)
    Now,, I have a new MacBook Pro Retina 15".   There is no Eject key.  Is there any other way for Hot Key to Shut Down?   I mean real Hot Key.   I do not want more than one press!

    Easiest way I found to shut down a mac is to press the power button, which brings up the shutdown, restart dialog window, and then hit the enter key as shutdown is pre-selected. No need for the multiple keypress.

  • Unable to move object

    Hey there everyone, I'm new to flash and following a tutorial on how to make a small game. I've made some subtle changes, namely I imported .png's and made them into shapes and now am trying to move them. Here is the tutorial:
    http://asgamer.com/2009/as3-flash-games-for-beginners-character-movement-handling-multiple -keypresses
    Here is an example of my two classes, as far as I know the ActionScript checks out ok...
    package com.spacerace
        import flash.display.MovieClip;
        import flash.display.Stage;
        public class Engine extends MovieClip
            public function Engine()
                var spaceBackdrop : Space = new Space();
                var playerShip : PlayerShip = new PlayerShip();
                stage.addChild(spaceBackdrop);
                spaceBackdrop.x = stage.width / 2;
                spaceBackdrop.y = stage.height / 2;
                stage.addChild(playerShip);
                playerShip.x = 60;
                playerShip.y = 100;
    package com.spacerace
        import flash.display.MovieClip;
        import flash.display.Stage;
        import com.senocular.utils.KeyObject;
        import flash.ui.Keyboard;
        import flash.events.Event;
        public class PlayerShip extends MovieClip    {
            private var stageRef:Stage;
            private var key:KeyObject;
            public function PlayerShip(stageRef:Stage)
                this.stageRef = stageRef;
                key = new KeyObject(stageRef);
                addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
            public function loop(e:Event) : void
                y--;
    I'm completely at loss to what the problem could be, everything appears fine on screen, but the ship simply doesn't move.

    Ah yes, can't believe I missed that. However I'm getting another problem now. When I attempt to pass a reference of stage into the constructor the compiler throws an error:
    1136: Incorrect number of arguments.  Expected 0.
    I'm not sure why I'm getting this as the PlayerShip constructor is set up to accept a reference of Stage.

  • How do you register multiple key presses at the same time?

    Hi. I'm trying to write a first person game in OpenGL and I'm having some trouble with key listening. Right now I just use the basic AWT KeyListener. The problem that arises is that whenever I hold down a key, such as a movement key, there is a short pause after it moves me in the appropriate direction, and only after the pause does it start continuously moving me. In addition to that, I can't press multiple keys at once to get diagonal movement (I use WASD for movement). Is there something I can do with AWT to fix both of these problems, or is there something other than AWT that I should use that would be better?

    the pause is the typomatic rate of the keyboard, you can avoid that by using the keyPressed and setting a flag then a sleep(myDelayTime).... if they keyRelease--and clearing of the flag--hasn't happened after the sleep, then you're key is still down so keep firing, moving, or what ever.

  • RemoteApp receives multiple KeyUp events without any keys being pressed

    Hi All,
    I have a very simple winforms app that I am using to try and track down what is happening with keyboard events when using RemoteApp.
    Basically I have a form and a textbox that track the KeyDown, KeyPress and KeyUp events.
    As soon as I start my app via RemoteApp I receive multiple KeyUp events without even pressing a key.
    Does anyone know why RemoteApp would be sending these random KeyUp events.
    The code of my simple test app is as follows:
    Public Class Form1
    Dim lst As New List(Of String)
    Private Sub AddtoList(str As String)
    lst.Add(str)
    End Sub
    Private Sub TextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    AddtoList("txt KeyDown" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    AddtoList("txt KeyPress" & vbTab & "KeyChar is " & e.KeyChar)
    End Sub
    Private Sub TextBox1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
    AddtoList("txt KeyUp" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    AddtoList("Form Closing")
    IO.File.AppendAllLines(Application.StartupPath & "\SimpleKeyUp_v2.txt", lst)
    End Sub
    Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    AddtoList("Form KeyDown" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub Form1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
    AddtoList("Form KeyPress" & vbTab & "KeyChar is " & e.KeyChar)
    End Sub
    Private Sub Form1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
    AddtoList("Form KeyUp" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    AddtoList("Form Load")
    End Sub
    End Class
    Simply opening and closing the app via RemoteApp gives the following results:
    Form Load
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form KeyUp KeyCode is 16
    txt KeyUp KeyCode is 16
    Form KeyUp KeyCode is 16
    txt KeyUp KeyCode is 16
    Form KeyUp KeyCode is 17
    txt KeyUp KeyCode is 17
    Form KeyUp KeyCode is 17
    txt KeyUp KeyCode is 17
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form KeyUp KeyCode is 18
    txt KeyUp KeyCode is 18
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form KeyUp KeyCode is 18
    txt KeyUp KeyCode is 18
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form Closing
    Cheers and Thanks in Advance!
    Dwayne

    Hi,
    It seems that your issue has been out of the scope of this forum.For coding issue,I suggest you ask in the
    MSDN forum to see whether anyone can help you out.
    Regards,
    Clarence
    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Maybe you are looking for

  • ACS 5.3 - Error when changing Device group or Location

    I am trying to move a device from the Default location to a sub group and get the following message when I try (either with IE or Firefox) This System Failure occurred: Index : 0, Size: 0. Your changes have not been saved. Click OK to return to the l

  • Business Transaction Control is not Working for Equipment Status.

    Hi All, I have created a Status Profile for Equipment / Functional Location & assigned 5 Status under this Profile i.e. NEW, COM (Commissioning), INS(Inservice), CAM (Care & Maintenance) & DCM (De Commissioned). For Status DCM i have assigned Transac

  • Problem in triggering the Supply Function

    Hi Experts, I am developing one web dynpro application to display the records in MARA table. I have created a radio button.Logic is if radio button is selected then displaying of the record should be done. NODE_PARENT consists of   NODE_CHILD ( which

  • Freezes while playing video in iTunes

    I don't know if this is a hardware issue, or software, which I doubt because I did a clean install of Snow Leopard. But anyway, I have this issue when I am watching video podcasts or movies where it would freeze for a couple of seconds, and then woul

  • Accounting transaction category RMWQRMWQ000000100000 is not defined.

    Hi Friends I am getting the message while rejecting  ASSET after checking in Quality inspection in QA11 T code. Accounting transaction category RMWQRMWQ it is asking FI-AA settings. Accounting transaction category RMWQRMWQ000000100000 is not defined.