Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onKeyDown works in Flash preview but not when swf is in browser

    I'm using the code (below) and it works when previewed in Flash, but once online (or in any browser locally) it doesn't... newbie would love feedback!

    // KEYSTROKE LISTENER
    attachMovie("mc_watermark","waterMC",5000);
    waterMC._y = 50;
    waterMC._alpha = 0;
    var keyListener:Object = new Object();
    keyListener.onKeyDown = function() {
    if (Key.getCode() == key.SHIFT) {
    waterMC._alpha = 80;
    } else if (Key.isDown(154)) {
    waterMC._alpha = 80;
    System.setClipboard("Contact");
    }
    };
    Key.addListener(keyListener);

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Are you sure that when you are testing i nthe browser that Flash has the windows focus?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •