Adobe Dreamweaver Forums



Last 10 THreads :         Can't get Macromedia Authorware Web Player to install onWindows Vista (Last Post : Steve Howard **Community Expert** - eLearning + Mo - Replies : 1 - Views : 2 )           »          Can I make a 4 state CSS Sprite nav bar. (Last Post : Team Liquid Fire - Replies : 8 - Views : 9 )           »          3 overlapping background images on same page (Last Post : brad_goldstein - Replies : 10 - Views : 11 )           »          fireworks exports hundreds of files (Last Post : JoeyD1978 - Replies : 1 - Views : 2 )           »          DW or FW? (Last Post : JoeyD1978 - Replies : 1 - Views : 2 )           »          cfdocument printing issues: cf7 vs cf8 (Last Post : k43 - Replies : 1 - Views : 2 )           »          wont work in IE (Last Post : ckovy - Replies : 2 - Views : 3 )           »          Re: CS4 GPU Acceleration and Intel X3100 (Last Post : Intel - Replies : 0 - Views : 1 )           »          cs4 full screen mode isn't saved in workspaces, unlike cs3 (Last Post : eddie caruso - Replies : 2 - Views : 3 )           »          Problem with Subversion (Last Post : tmortime - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-04-2008, 09:02 AM
angrymob
 
Posts: n/a
Diggs:
Default Global keyboard listening does not work

Here's a sample app that tries to listen for global keyboard events, but fails
to work. Why, I'm not sure. Is this a bug? This seems like it ought to be
pretty easy to achieve, considering how many people are going to want to do
this...

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
backgroundColor="#FFFFFF"
applicationComplete="registerGlobalKeyHandler()">

<mx:Script>
<![CDATA[
public function registerGlobalKeyHandler() :void
{
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
}

public function handleKeyDown(event:KeyboardEvent) :void
{
display.text = "Key was pressed: " + event.keyCode;
}
]]>
</mx:Script>

<mx:Panel>
<mx:Canvas width="400" height="400">
<mx:Label id="display"
text="Click anywhere in the application and then press some keys." />
</mx:Canvas>
</mx:Panel>

</mx:Application>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-04-2008, 09:02 AM
angrymob
 
Posts: n/a
Diggs:
Default Re: Global keyboard listening does not work

Hmm, this appears to be a bug in my flashplayer stand-alone; in my browser it works fine.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 01:54 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk