School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,444 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,527 people online right now. Registration is fast and FREE... Join Now!




AS3 problem with key code for F10

 

AS3 problem with key code for F10

ZavStrast

16 Jun, 2009 - 10:14 AM
Post #1

New D.I.C Head
*

Joined: 10 Oct, 2008
Posts: 4


My Contributions
Hi,
I am using Flash CS4 with AS3. I am creating a module that uses different key presses/input text type of events throughout the entire module. Everything is working fine, but I cannot get the "F10" key code to work in flash.

Here is my coding in the actions layer for the key press:
CODE
stop();

next_btn.visible = false;

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandlerF);
function keyDownHandlerF(event:KeyboardEvent):void
{
   if(event.keyCode == Keyboard.F10)
    {
        next_btn.visible = true;
        stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandlerF);
        gotoAndStop(currentFrame + 1);
    }
    else
    {
        gotoAndStop(currentFrame);
    }
}


It's the exact same code I am using for my other key presses like the F4 key that work just fine. (It's the same code as listed above, but with a different named event listener and is calling the "Keyboard.F4".)

Any idea why the F10 won't work?? Or any solution as to what I can do??

Thanks!

User is offlineProfile CardPM
+Quote Post


BetaWar

RE: AS3 Problem With Key Code For F10

16 Jun, 2009 - 10:28 AM
Post #2

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,729



Thanked: 269 times
Dream Kudos: 1400
My Contributions
My best idea is that Flash has a shortcut for F10 and not F4, which would mean that Flash it taking the input and not giving it straight to the movie which is testing. You will see the same type of issue if you press V or B when looking at a preview swf in Flash (it will change the tool in Flash, but the swf won't get the event).

HTH
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:36AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month