3 keys simultaneously won't work in as3?

I was writing some code for a top-down game in flash CS3
(as3), where a hero would be able to move in 8 directions(using the
arrow keys) and shoot (using the spacebar) simultaneously.
I ran into a problem with these keys working simultaneously,
so I made a simple example to troubleshoot the issue. I started by
making a square on the stage that's 50 pixels by 50 pixels, turning
it into a movie clip and making it a class that my code uses, named
"myBox".
I made an example that detects the keys that are pressed and
lowers their opacity in response. I wanted to test all eight
directions with the spacebar. All combinations work, except when
you hold "up arrow" + "left arrow" + "spacebar"
This would make it impossible for my hero character to move
up-left and shoot at the same time. Bummer! Why do all the other
combinations work, except for up-left and spacebar?
Any help would be greatly appreciated. Is this a limitation
of flash?
My code is attached:

Can you post a link where it doesn't work?
Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
* Don't make any changes on the Safe mode start window.
See:
* [[Troubleshooting extensions and themes]]

Similar Messages

  • Hi my iMac has decided to come up for the 5 time Work the ?  Symbol just tris time everytime i try to restart the iMac with any key it won't work, then I try also i knserted the installation dvd and it does not, If media is getting scratched in the drive

    Hi my iMac has decided to come up for the 5 time With the ?question mark   Symbol just this time when i try to restart the iMac with any key it won't work, then I try also to insert the installation dvd and stard with yhe C or D key
    Still no way to grt it starting, also I notice the DVD drive is getting scratched in the drive just before it outomaticly ejected.
    media is getting scratched after been used and ejected by my iMac without loading .
    Please help!!! I  to finish my college work and have no way of  work on it! HELP
    Thanks

    Boot off your *original* Install Disk while holding down the *d key*, (not c key), then run the extended Apple Hardware Test. Some disks require you to use the Option key at bootup to select AHT. Some models have a separate AHT CD. Some have it on the Disc #2.
    The Memory test can really only be trusted if it finds a problem, not if it doesn't find a problem.
    Memtest OS X...
    http://www.memtestosx.org/joomla/index.php
    Rember is a freeware GUI for the memtest ...
    http://tech.kateva.org/2005/10/rember-freeware-memory-test-utility.html

  • Key binding won't work with alt-up and alt-left arrow combined

    I was playing with key binding trying to create a small app where a timer is started with the press of an alt-arrow key and stopped when the key is released. The timers append Strings to a JTextArea telling which alt-arrow key is currently pressed.
    This program works, and in fact if you press a combination of any two keys, both timers will work simultaneously, that is unless you press both up arrow and left arrow together. Can anyone see a bug in the program that explains why it won't work for these two particular keys when combined? Thanks in advance, Pete
    My SSCCE,
    KeyBindingEg.java
    package javaforum2009;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.*;
    public class KeyBindingEg {
      // parallel arrays -- sorry
      private static final int[] ARROW_KEYS = {
          KeyEvent.VK_UP, KeyEvent.VK_DOWN,
          KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
      private static final String[] ACTION_STRINGS = {
        "Up", "Down",
        "Left", "Right" };
      private static final String PRESSED = "PRESSED";
      private static final String RELEASED = "RELEASED";
      private static final int TIMER_DELAY = 100;
      private JPanel mainPanel = new JPanel();
      private JTextArea textArea = new JTextArea(20, 30);
      public KeyBindingEg() {
        JPanel northPanel = new JPanel();
        northPanel.add(new JLabel("This JTextField has the focus: "));
        northPanel.add(new JTextField(10));
        textArea.setEditable(false);
        mainPanel.setLayout(new BorderLayout());
        mainPanel.add(northPanel, BorderLayout.NORTH);
        mainPanel.add(new JScrollPane(textArea), BorderLayout.CENTER);
        setBindings();
      private void setBindings() {
        int context = JComponent.WHEN_IN_FOCUSED_WINDOW;
        InputMap inputMap = mainPanel.getInputMap(context);
        ActionMap actionMap = mainPanel.getActionMap();
        for (int i = 0; i < ARROW_KEYS.length; i++) {
          // timer is started on key press and stopped
          // on key release.
          Timer timer = new Timer(TIMER_DELAY, new KeyTimerListener(
              ACTION_STRINGS));
    timer.setInitialDelay(0);
    // get input maps for all alt-arrow keys for both key press
    // and key release
    inputMap.put(KeyStroke.getKeyStroke(ARROW_KEYS[i],
    InputEvent.ALT_DOWN_MASK, false), ACTION_STRINGS[i] + PRESSED);
    inputMap.put(KeyStroke.getKeyStroke(ARROW_KEYS[i],
    InputEvent.ALT_DOWN_MASK, true), ACTION_STRINGS[i] + RELEASED);
    // set corresponding actions for the two different key presses above
    actionMap.put(ACTION_STRINGS[i] + PRESSED, new ArrowKeyAction(false, timer));
    actionMap.put(ACTION_STRINGS[i] + RELEASED, new ArrowKeyAction(true, timer));
    @SuppressWarnings("serial")
    private class ArrowKeyAction extends AbstractAction {
    private boolean onKeyRelease;
    private Timer swingTimer;
    public ArrowKeyAction(boolean onKeyRelease, Timer swingTimer) {
    this.onKeyRelease = onKeyRelease;
    this.swingTimer = swingTimer;
    public void actionPerformed(ActionEvent arg0) {
    if (onKeyRelease) {
    swingTimer.stop();
    } else {
    swingTimer.start();
    private class KeyTimerListener implements ActionListener {
    private String actionString;
    public KeyTimerListener(String actionString) {
    this.actionString = actionString;
    public void actionPerformed(ActionEvent arg0) {
    textArea.append(actionString + " pressed\n");
    public JComponent getPanel() {
    return mainPanel;
    private static void createAndShowGUI() {
    JFrame frame = new JFrame("KeyBindings Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(new KeyBindingEg().getPanel());
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

    camickr wrote:
    I noticed the problem a while ago with a similiar example and asked the same question to which nobody could give an explanation. The same observations seem to apply to your example in that using the numpad arrow keys work without a problem.
    [http://forums.sun.com/thread.jspa?threadID=5176816]
    Yes indeed. I suppose (as always) I should have searched the forum first before asking the question. Thanks for the link and info.
    /Pete

  • 3 keys still won't work after getting wet

    I still have 3 keys that do not work the caps lock, left apple key, and tab. When you purchase a new keyboard it is just the key caps correct? Or would a new keyboard fix my problem.

    Hello Murrs438,
    After reviewing your post, I have located an article that can help in this situation. It contains a number of troubleshooting steps and helpful advice concerning iMessage issues:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Learn how to resolve issues with the Messages app on your iPhone, iPad, or iPod touch. You'll learn what you need to send messages using SMS, MMS, and iMessage as well as how to resolve issues with each method.
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Numbers on key pad won't work

    Somehow I managed to get my numbers on the key pad locked out. How do I turn them back on?

    Hi, and welcome to the forums.
    Go to +System Preferences > Universal Access > Mouse+ and make sure the +Mouse Keys+ button is OFF (or the +Press the Option key ...+ box is checked).
    It's a handy way to be able to use your Mac if your only mouse is broken.
    Message was edited by: Pondini

  • Keys ±, 3, e, d and c won't work on wireless keyboard so I cannot log in to  my iMac

    Keys ±, 3, e, d and c won't work on my wireless keyboard. I cannot log in to my iMac because my password includes a 3. I've tried logging in as a guest user and tested the keyboard with Safari. The problem keys do't work there either so it looks like a keyboard issue rather than a software one. Does anyone have any ideas about fixing it please?
    (I'm sending this plea from my trusty MacBook Pro!)

    Try resetting the PRAM. It may also be that that key has failed......
    Barry

  • Fn F7 keys won't work in BootCamp on MBP

    I'm trying to use a projector with my MBP to teach CAD in BootCamp. The problem is that I can't mirror my screen when using bootcamp, like I can in OS X. I can get an extension of my screen, but can't display the contents of my screen on the projector.
    Normally you would use the fn F7 keys to toggle through the display options, but in Windows XP the fn F7 won't work.
    Does anyone have any ideas? A remapping program for MBP? Please Help.
    Brett

    Have you tried the windows way (right click on desktop > properties > settings and uncheck Extend my Windows desktop... ?
    Hope this helps...

  • My i-pod key pad/wheel won't work unless it is hooked up to my computer

    I bought my i-pod a while back, and it has worked fine until now. My i-pod key pad/wheel thing won't work unless I have it hooked up to my computer. When it is hooked up it works fine, when it isn't hooked up the key-pad/wheel thing won't respond to any thing, it just won't work. Please help me figure out what is wrong with my i-pod and fix it!!!!!

    No. Back it up anyway. If you can't use the built-in backup function of iTunes, find the library in the Windows Explorer and back that folder up as you would any other.
    (60174)

  • Page Up and Down keys won't work - have tried everything

    My Page Up and Down keys won't work. I've tried hitting F7, the Fn key, checked that the "Always use cursor keys to navigate" box is not selected in the Advanced Options tab and made sure that the "Use autoscrolling" tab is selected. I tried uninstalling and re-installing Firefox, tried hitting buttons F1 through to F12 and then checked that accessibility.warn_on_browsewithcaret is set to 'true'.
    It also won't work in Internet Explorer - I have no idea what else to try. My Up/Down arrows are working, just not the Page Up/Page Down buttons. Please help, this is driving me nuts. It's only just started happening; I've never had a problem with it before!

    What is the value of the pref [http://kb.mozillazine.org/accessibility.browsewithcaret accessibility.browsewithcaret] on the about:config page?
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • I purchased the package that allows you to export PDF files into Word files.  Whenever I try to export the PDF into a Word file it never works...  I don't know if there's something key that I'm missing but I'm pretty bummed I paid for it and it won't work

    I purchased the package that allows you to export PDF files into Word files.  Whenever I try to export the PDF into a Word file it never works...  I don't know if there's something key that I'm missing but I'm pretty bummed I paid for it and it won't work.  Can anybody help me out?

    Hello,
    I have paid for this service for a year and it never worked on my computer.  I just renewed and it finally converted the file but it will not let me edit it.  I join you in being bummed.  Either I get help with this or I am asking for a 2 year refund.   My intention was to be able to edit a pdf in MS Word. 
    pfierrorob

  • My key between z and c won't work

    I am getting dings! My, well, key between z and c won't work in either case and dings at me when pressed. My MacBook is fairly new and I have never had any trouble before. Who knew I would need that key so much?

    The first thing that comes to mind is that you might have accidentally set up the "x" key to be a keyboard shortcut ... which results in an error because whatever it's a shortcut for is often not possible in the context when you're typing.
    Check System Preferences, in the Keyboard and Mouse section, and click on the Keyboard Shortcuts tab. I would first check at the bottom where you can add custom keyboard shortcuts, but you may also need to look through the other sections to see if you somehow set "x" to be a shortcut for any of them.
    Of course, if you remember going into that preferences section, you might be able to more quickly determine what happened...

  • Arrow Keys Won't Work on Many Websites

    On many game sites, the arrow keys won't work at all, so I'm not able to play. The hardware is fine, they work fine in email and Word, just not on the game sites. Do I have a setting wrong? I've checked everything (I think....)
    Thanks!!!

    The arrow keys are working for me in the game on http://www.ezone.com/games/jazzy/gamecode.htm. The arrow keys work slugishly for me in the game I tried on www.freeonlinegames.com/play/3350.html. The third sight seems to require registration so I did not try it.
    Freeonline games was more responsive for me using Firefox, you might want to give this browser a try and see how it behaves.

  • "C" key CD start won't work............

    I tried starting from a CD several times using the "C" key at restart - but it just won't work!
    Any ideas as to why?
    Thanks

    As far as I know the tech tool CD is not boot compatible with any Intel based Mac including the MacBook Pro. The repair utilities may be, I haven't tried them. As far as I can tell, the information is not officially posted anywhere on Apple's website but my past experience says that it takes weeks to months for the AppleCare discs to be updated.
    This may be official. It says that Tech Tool Pro is not compatible with the MacBook Pro:
    Micromat Forums--Tech Tool Pro on MacBook Pro

  • The Up Arrow Key Won't Work!

    Whenever I try to use the up arrow key on my MBP, it doesn't respond. For example, on any application I use, it won't work. But, for some reason, whenever I play Empire At War, it works perfectly.
    What should I do?

    To be honest there is a lengthy process involved. If you are able to call APPLE support. try that. If not let me know and I will continue.

  • HT1379 Some keys won't work?

    What causes some of my keys not to work?

    You'll need to provide some additional information .... what keys won't work, what is running on the system when that happens, does it only happen after an event, like waking from sleep or ? If you reboot or shut your system down and restart does that fix it for some period of time?

Maybe you are looking for