Flex kbd event help

Using the example I found at http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64a29-7fdb.html, I modified my Flex app to listen for keyboard shortcuts being pressed.  It works but only after the user clicks on a blank spot on the web page.  Why?  This is for accessibility and if I make my blind users click using a mouse, it defeats the purpose... Is there a fix for this so that the keystrokes are detected without clicking on the page or am I doing something wrong?
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application 
xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
library://ns.adobe.com/flex/spark" xmlns:mx="
library://ns.adobe.com/flex/mx"creationComplete="init()"
minWidth="
955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script source="BGBasicPlay.as" >  
</fx:Script>  
<fx:Script>
<![CDATA[
import mx.core.FlexGlobals; 
protected function init():void {FlexGlobals.topLevelApplication.addEventListener(KeyboardEvent.KEY_DOWN,keysPressed);
// has to set focus then click to work!!!
protected function keysPressed(evt:KeyboardEvent):void {txtKeys.text = evt.keyCode +
"/" + evt.charCode; 
var nKeyPressed:int = evt.keyCode; 
if (nKeyPressed == 80 && evt.shiftKey == true){
PlaySong2();
else { 
if (nKeyPressed == 80 && evt.shiftKey == false){
PlaySong();
]]>
</fx:Script>
 <s:Button x="250" y="105" label="Play Song" id="btnPlay" />
 <s:TextInput x="224" y="63" id="txtKeys"/></s:Application>

After wading through over 100 posts, most were either unanswered or had general replies such as yours with no real useful information on how to do this.
The closest answer I found was this:
"This is a known bug of Flash Player/Mozilla browsers - SWF does not receive focus at start-up.
I am not aware about any suitable workaround available. The closest workaround is to place a button and allow user to click on it which will give SWF a focus.PS It works in IE without any problem. Good old MS "
That answer was posted in 2008.  It is now 2011 and you would think that this would have a fix by now... especially with all of the pressure for accessibility.  IE 8 apparently now has this problem as well.
So, instead of sending me on a wild goose chase, it would really have been more helpful to have received an actual answer from you.

Similar Messages

  • Flex Complete Event

    Hi guys,
    Just trying to find answers regarding problems with Mac
    players on the complete event in flex. Please help. I really need
    an alternative to be used in my uploader project. My multiple file
    uploader doesn't seem to work in Mac, only the first file was being
    uploaded since the complete event is not working, it intends to be
    that the other files in queue was not uploaded and has stopped
    after the first file.
    Any help would be very much appreciated. Thank you in
    advance.

    Ah I figured it out.  It seems that if I don't call addChild(img) (which I had been commenting out while trying to defer it for processing) then img.load(url) is never called so therefore the Event.COMPLETE won't run just on what I had.

  • Flex upload problem - Help!

    Hi. I've got a JSP page that works fine when I upload a file
    to it from another JSP page, using simple Browse and Submit
    buttons. I've deployed the Flex 3 SWF to the same folder as the JSP
    page and am trying to upload a file from the Flex app and keep
    getting this error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File
    I/O Error.
    at
    TV_Schedule()[C:\flexTest\_workspace\TV_Schedule\src\TV_Schedule.mxml:9]
    at _TV_Schedule_mx_managers_SystemManager/create()
    at
    mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.0.x\frameworks\projects\fr amework\src\mx\managers\SystemManager.as:2438]
    at mx.managers::SystemManager/
    http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.0.x\frameworks\proj ects\framework\src\mx\managers\SystemManager.as:2330
    On the Tomcat server's error log, it has the following,
    [Fri Aug 22 12:16:19 2008] [error] [client xxx.xxx.xx.xxx]
    mod_security: Access denied with code 403.
    Error processing request body: Multipart: final boundary
    missing [hostname "myhost.mydomain.org"] [uri
    "/myfolder/upload.jsp"]
    I've read that if we put the following in an .htaccess file
    in the root, it will get rid of the problem,
    SecFilterEngine Off
    SecFilterScanPOST Off
    However, this opens us up to all kinds of attacks. I've read
    that the "Multipart: final boundary missing" is a known issue. Is
    this true? Are there documents on this? Will the next version of
    Flex fix this?

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    All Classes (Flex 3):
    mx.automation, The Flex automation framework uses the
    AutomationID class to ..... The FileReference class provides a
    means to upload and download files
    Link:
    http://livedocs.adobe.com/flex/3/langref/class-summary.html
    Flex cookbook beta - Uploading files from Flex using PHP:
    Flex cookbook beta - Code a control so that end users can
    upload a file ... text=Error #2038: File I/O Error. And the
    permissions for the folder are 777 so
    Link:
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=5241&produ ctId=2
    F (Flex 3):
    The FileReference class provides a means to upload and
    download files ...... handle error messages, and bind your form
    data to the Flex data model to
    Link:
    http://livedocs.adobe.com/flex/3/langref/all-index-F.html
    Flex Solutions:
    MORE FLEX FRAMEWORK LIBRARIES AND UTILITIES. 709. 12.
    Excerpted from Flex Solutions, .... invoked if an error occurs in
    the upload phase of the file:
    Link:
    http://www.adobe.com/devnet/flex/articles/upload_files/uploading_files_to_the_server.pdf
    [#FP-292] uploading of files: io error 2038 on Apache - app
    ok on:
    Actual Results: Expected Results: Upload file Workaround (if
    any): ... This error is also seen when using Flex 3 and has been
    pending for a really long time
    Link:
    http://bugs.adobe.com/jira/browse/FP-292
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • Opening dbs thru button events, help, i`m a newbie..

    i have the following fn for opening the db
    public static void main(String args[]) throws Exception
    new login(new javax.swing.JFrame(), true).show();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    open();
    select();
    static void open() throws SQLException
    // ODBC data source name
    String dsn = "jdbc:odbc:dslogin";
    String user = "";
    String password = "";
    // Connect to the database
    con = DriverManager.getConnection(dsn, user, password);
    // Shut off autocommit
    con.setAutoCommit(false);
    static void select() throws SQLException
    Statement stmt; // SQL statement object
    String query; // SQL select string
    ResultSet rs; // SQL query results
    boolean more; // "more rows found" switch
    query = "select user,password from dblogin";
    stmt = con.createStatement();
    rs = stmt.executeQuery(query);
    // Check to see if any rows were read
    more = rs.next();
    if (!more) {
    System.out.println("No rows found.");
    return;
    // Loop through the rows retrieved from the query
    while (more)
    // System.out.println("kkkk");
    System.out.println("umm" + rs.getString("user"));
    System.out.println("ummmm" + rs.getString("password"));
    more = rs.next();
    rs.close();
    stmt.close();
    now my problem is this..while the above open and select fns work fine in void main, i`m trying to open the db upon clicking a button..heres what i tried to do :
    cmdsubmit.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    cmdsubmitActionPerformed(evt);
    private void cmdsubmitActionPerformed(java.awt.event.ActionEvent evt) {
    open();
    seelct();
    when i try it i get the error message exceptions must be caught or throw or sumthing like that and i`m new to java so i`ve no idea how to go about doing it..help please..

    On JDBC:
    You only need to register a driver with the DriverManager once, and this is done (by JDBC conform drivers) when the driverclass is loaded. You may want to do this in a static initializer:
    import java.sql.*;
    class MyClass{
        static {
            try {
                // load driver class, which automatically registers itself
                Class.forName("sun.jdbc....");
            } catch(Exception ex) { /* handle it, throw error */ }
        // later
        Connection con = DriverManager.getConnection(...);
    }Even better is NOT to hard-code the driver at all. Use
    java -Djdbc.drivers=sun.jdbc.odbc.JdbcOdbcDriver;oracle.jdbc.OracleDriver MyClassinstead.
    Fritz

  • Event help please!!!

    Hello
    In a game I am currently making I have had some problems with The keyPressed() and keyReleased() methods. If i press spacebar to fire (its in keyReleased()) while i'm moving, my ship will stop (since the moving is controlled with keyPressed()). Also, on my computer I can move diagonally (ie hold two keys at once) but on my friends computer he can't. Third, my high score screen glitches if SHIFT is held down. So here are my questions:
    Is there any way to use keyPressed() and keyReleased() at the same time, or do they always conflict?
    Why is my friend's computer not registering two keyPressed()s at the same time, and is there any way i can fix this?
    Is there any way to check if a key pressed/released/hit is a key that gives a valid ASCII character?
    Any help is truly appreciated!!!

    You need another thread I am betting. You should not do any work in the event thread. just get the data out of the event thread but your work should all be done in another thread, or else just what you are talking about will happen. when the event thread is interrupted, your app will stop.

  • Flex with Red5 Help.....

    Hi everybody.... I need information about using Red5 with
    Flex.... Im newbie about it. Does anybody know about tutorials or
    something that it can help me....

    I guess you can find some information at http://www.red5chat.com

  • Flex and Linux help

    I have some socket code that works fine in Windows and Mac.
    However, the socket
    wont connect or
    throw an error in the Linux flash player (debug or normal).
    Below is a code fragment. I can't find any reference to any special
    circumstances for Linux. If I am doing something wrong, then some
    help would be greatly appreciated.
    import flash.net.Socket;
    import flash.events.IOErrorEvent;
    import flash.events.SecurityErrorEvent;
    import flash.system.Security;
    private var socket: Socket = new Socket();
    public function connectToLogger( ipAddress: String = null,
    ipPort: int = 8000): void
    // event for when the server connection is established.
    socket.addEventListener( Event.CONNECT, onConnect );
    // event for when the server closes the socket.
    socket.addEventListener( Event.CLOSE, onClose );
    // event for when there is an I/O error event logged during
    connection.
    socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
    // event for when there is an security error event logged
    during connection.
    socket.addEventListener( SecurityErrorEvent.SECURITY_ERROR,
    onSecurityError );
    // Listen for when data is received from the socket server
    socket.addEventListener( ProgressEvent.SOCKET_DATA,
    onSocketData );
    try
    trace( "Trying to connect (" + ipAddress + ": " + ipPort +
    socket.connect( ipAddress, ipPort );
    catch( error: SecurityError )
    trace( "socket.connect error" + error );
    catch( error: IOError )
    trace( "socket.connect error" + error );
    trace( "socket.connected = " + socket.connected );

    Turns out it was a bug in the Flash player. The beta player
    released on 21st of August 2007 successfully connects from
    Linux.

  • Flex Beta 3 Help Documantation

    Hi all,
    I hv installed Flex 2 Beta 3 version ...
    While using this i found that...
    User can only view the help about flex 2.0
    when the flex builder is open.
    Don't the adobe team think that documentation should be
    separate as
    in flex 1.5
    with kind regards,
    vinay sharma

    Hi,
    Check the Adobe Labs Site there you can find the current
    documentation of Flex 2.
    Here is the link:
    Documentation

  • Flex QTP Plugin  Help

    Where can I find help for Flex Controls and Methods in QTP
    for 9.2 Version QTP and Flex 3 Beta 2 ?

    Hey KV,
    I found some interesting posts on the forums, mostly pissed
    off people who cant get answers. Try these links.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=583&threadid =1269878&enterthread=y
    http://labs.adobe.com/wiki/index.php/Flex_3:Release_Notes
    I'm in the same situation as you, qtp automation of a flex
    product, and havent been able identify flex objects. I have been
    able to identify activeX but qtp tags them with coordinates which
    won't work for our automation.
    I work with an ex - adobe tier 3 support guy so I can see why
    no one can help here on the adobe forums...
    Good luck!

  • New to flex, need some help

    Hello, I am a new user of Flex 4 and have recently gone thru the training courses available here (Flex in a week).  I have been tasked with moving some of our firm's webpages that use jsp and spring to connect to a mysql database to a flex frontend. 
    I've been looking over the BlazeDS tutorial (http://www.adobe.com/devnet/flex/articles/spring_blazeds_testdrive.html) and it seems rather helpful, but I could use some help in how to make a connection to a mysql database on an external server-- where does the connection info go, user name, password, etc. 
    In a nutshell, the application I am to design would need to be able to go out to a database to first verify user credentials, then to upload csv files and store the data into a database, and finally allow users to retrieve the data in datagirds and display in basic bar charts.  Thanks to the training, I have a good understanding on using the datagrid, but the connecting to an external database is where I'm having trouble. 
    Also, I have seen a flex webpage where data is displayed in a chart and the user can export the chart as a jpg or export the input data to a csv file.  Is anyone familiar with this capability?
    Thanks for your help-- I am excited to learn all there is to know about Flex!

    I would you should read the following link completely.
    http://www.adobe.com/devnet/flex/articles/flex_hibernate.html
    You need to create an Client/Server-application with 3-tiers client, application server (Java/Hibernate/Spring) and database server (MySQL for example).
    Just buy a book over Flex and Java and read it.

  • Button Event Help

    Hi, I have created a Frame that the user can draw in. It is a separate class that I call in my main program from a different file. I have a button on my frame that I want to run a method to save the graphical contents of the frame as a type Image. This works fine, and I have created the image. Now I need to return the image to my main program somehow. I want it only to return to my main when the button is pressed. The actionPerformed cannot contain a return statement, and I cannot call a getImage (from the frame) in my main anyway, because I want it to be initiated by the button push, which is located in the Frame file and not in the main. Can anyone help me? I will post the code. Ignore the Picture and InterruptedException in my actionPerformed class, they just convert the image in other classes, but they're not important. An explanation to return the image would be perfect.
    Here is my main:
    class LoadPictures
        public static void main (String [] args) throws IOException, InterruptedException, AWTException
            PaintArea pa = new PaintArea ();
            pa.loadArea (pa);
    Picture pic= pa.getPic() //<---false method. This is what I want to happen when you click the button in the frame.
        }}Here is my frame, entitled PaintArea:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    class PaintArea extends Frame
        static int x, y;
        static Graphics g;
        PaintArea ()
            addWindowListener (new WindowAdapter ()
                public void windowClosing (WindowEvent e)
                    hide ();
            setSize (400, 400);
            setVisible (true);
            g = getGraphics ();
        public void loadArea (PaintArea pa)
            Button button = new Button ("Save");
            // pa.add (button);
            button.setSize (2, 2);
            pa.show ();
            final PaintArea pa2 = pa;
            button.addActionListener (new ActionListener ()
                public void actionPerformed (ActionEvent ae)
                    try
                        Image image = pa2.saveScreen (pa2);
                        //Picture pic = new Picture (pa2);
                    catch (AWTException e)
                        System.err.println (e);
                        System.exit (1);
                    // catch (InterruptedException ie)
                    //     System.err.println (ie);
                    //     System.exit (1);
            pa.addMouseListener (new MouseAdapter ()
                public void mousePressed (MouseEvent me)
                    x = me.getX ();
                    y = me.getY ();
                    g.fillOval (x - 5, y - 5, 10, 10);
            pa.addMouseMotionListener (new MouseMotionAdapter ()
                public void mouseDragged (MouseEvent me)
                    x = me.getX ();
                    y = me.getY ();
                    g.fillOval (x - 5, y - 5, 10, 10);
        public Image saveScreen (PaintArea pa) throws AWTException
            Image image = createImage (new Robot ().createScreenCapture (pa.getBounds ()).getSource ());
            return image;
    }Thank you very much, everyone!!

    When you open the frame, use wait() to suspend action in the main program. When the button is pressed, call notify() on the same object. Then the focus is back in the main program's code.

  • Event help

    Hi,
    Can anyone pass me a simple example showing how to use Events(Send,Receive & Raise) in workflow and also pass me any easy to understand document please.
    I have already read document comes with workflow but it has not help me.
    I will appreciate if someone can pass me a working example my email is [email protected]
    Regards,
    Saif

    Have a look at the white paper "Getting Started with the Oracle Workflow Business Event System and Advanced
    Queuing":
    http://otn.oracle.com/products/integration/workflow/workflow_wp_bes.pdf
    You might also consider taking the Oracle Workflow training courses available through Oracle University. There are both
    instructor-led classes and self-paced classes, the latter through OLN.
    Regards,
    Clara
    Hi,
    Can anyone pass me a simple example showing how to use Events(Send,Receive & Raise) in workflow and also pass me any easy to understand document please.
    I have already read document comes with workflow but it has not help me.
    I will appreciate if someone can pass me a working example my email is [email protected]
    Regards,
    Saif

  • Ical missing events  HELP!!

    i post new events on ical and they disappear when i next log on YET they apppear on my other computer which subscribes to this computer's diary
    there also appears to be sync problems
    anyone recognise this issue? have a solution?
    seems to have happened since last system update
    ALSO i have recently started using my ipod video for my diary rather than old clickcwheel not sure whether this is relevant?
    HELP!!
    andy

    I've had similar problems since the last update .. I've had to dos disappear but they are there ... I solved that.
    I also had events created/copied etc. but not show up until I moved to a different calendar display and return to the display (e.g. week) that I created them on.

  • Clientside eventing help

    Hello all,
    Where do i get good examples/tutorials in Client side eventing. I tried the one available in PDK but couldnot recreate the example. What is the jar file to find the package "com.sapportals.htmlb.enum.EventTrigger" and where do I find it.
    Thanks,
    Maya.

    Hi Maya,
       The EventTrigger class is available in htmlb.jar
    You can search for htmlb.jar in your portal installation
    It has all the classes related to htmlb including the eventing classes.
    PDK is a good resource for examples on anything and everything. You will have to do a bit of search. If you are looking for something specific then you can post the same.
    PS: Please consider awarding points for helpful answers just by pressing the yellow star button on the reply in question and choosing the corresponding amount of points. Thanks in advance!

  • IFrame eventing help

    Valery,
    Thanks for your help with IFrame. This message is in continution to the message Web Dynpro Java
    I opened seperate thread as the clarification required is different.
    Now the clock is running okay. However, I need to capture the time that is displayed when a user clicks button. Any code in WD, is getting server time which most of the time varies from the client side desktop.
    Is there any way I can code where I get the latest time from the client side desktop and pass this information back to the R/3.
    I know the portal eventing to get the time from IFrame is limited. It does not really matter if I read the time from IFrame or not. I think if I can get the client side time within the action of button click is okay.
    If you need more details, please do let me know.
    Thanks and Regards,
    Raju

    Raju,
    There is no way to pass any parameters to WD application except for portal eventing and start-up URL parameters.
    So it is impossible "to capture the time that is displayed when a user clicks button"
    But all you have to know is time shift in hours at application startup time. For this, create redirect HTML page that will get user time via JavaScript, append time as URL parameter to WD application URL and call
    window.navigate(<wd-app-url-with-param>);
    WD application may get this parameter and calculate time shift between user and server time. Calculate up to hours precision (time zones has only offset by hours). Store this shift value somewhere in component controller attributes.
    Now when you receive IWDButton.onAction event just add / remove shift from server time and pass this value to backend.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

Maybe you are looking for

  • How to cancel email notifications in ical?

    Please help. I share a work calendar with a colleague via ical and syncing via mobile me. When I as the "owner" of the calendar send or update an event in ical my colleague recieves an email notification. I update the calendar many times each day and

  • Adding Library in Java...HELP

    I just starting Java in school, and we got these books that need a library added to have the book's Import Directive to work. When I do the "add to project" option, the code builds but does not want to display an output picture... if you need the cod

  • Visual studio 2008 to visual studio 2013 for Bizunit project

    Hi Friends, I am migrating the visual studio2013,biztalk 2013.Part of the I am migrating the solutions in visual studio we have some bizunit projects implemented the VS 2008 now I am planning to migrate the vs2013.I am getting so many errors now. Err

  • Enable radio buttons of Item Category

    Hello Experts How can I enable the Item Category radio buttons from Item Group-setup form in SAP 8.81? Thanks & Regards, Prashant Muke

  • Move tool distress...

    Hello, I got this strange thing which, probably, easy can be solved: Normally when I want to select a layer I selected the Move-tool en pressed ctrl+on the part of the image in that particular layer (which worked fine for me). Now when I just click w