Works for me. I assume you are building a Desktop project?
I'm developing a desktop project on my windows box.
Do I maybe have to be developing on a Mac to see the Keyboard.COMMAND value?
Which version of Flex/AIR?
Flex 4.1 SDK.
Post a 20-line test case where it doesn't work.
It's not a running case since it won't compile, but if I comment out the line looking for Keyboard.COMMAND it works just fine.
The comment next to the line with Keyboard.COMMAND is a copy/paste of the compiler error message.
<?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">
protected function textinput1_keyDownHandler(event:KeyboardEvent):void
if (event.keyCode == Keyboard.SPACE) // <-- works fine
if (event.keyCode == Keyboard.COMMAND) // <-- 1119: Access of possibly undefined property COMMAND through a reference with static type Class. MacCommandKey.mxml /MacCommandKey/src line 15 Flex Problem
Because you are starting with <s:Application, it makes me think your app
isn't set up as a desktop/AIR app. Please double check your settings.
I'm writing a Browser/Flash app not a Desktop/AIR app.
Is Keyboard.COMMAND restricted to AIR only?
I'm writing a RIA and would like Mac users to be able to use their COMMAND key for list multi-select since this is what they are used to (both for web and desktop).
What is the suggested way of doing this for a Flex Flash/Browser app?
Only AIR apps have access to the Command key at this time. I asked you
about that in my first reply. I'm not aware of any workaround.
"Works for me. I assume you are building a Desktop project?:"
My immediate response was:
"I'm developing a desktop project on my windows box."
Sorry, I should have been more clear. When you create a new project you
have the option to choose Web or Desktop. Desktop implies AIR.