views:

600

answers:

3

How to capture CTRL+A, CTRL+C events in flex? It looks like they are special keys/combinations.

As I understand in Flex 3.4 I can capture CTRL+A by capturing Event.SELECT_ALL, and CTRL+C by capturing Event.COPY. BUT it complains that there are no SELECT_ALL static const in Event class.

I'm using Flex SDK 3.4 and Flex Builder for Linux (Ubuntu).

public function MyCanvas()
{
    super();

    focusEnabled = true;

    addEventListener(Event.SELECT_ALL, onSelectAll); // It complains here
    addEventListener(Event.COPY, onCopy); // and here
}
+1  A: 

According to Flex 3.4 language reference there is SELECT_ALL in Event class. What version of Flex SDK are you using? Can you post example of your code?

Update: It seems the SELECT_ALL has been added in Flash Player 10. Based on this.

Carlos
I've updated my question
zdmytriv
Thank you, it works great with Flash Player 10.
zdmytriv
+1  A: 

I don't see this from the API, but it could be an issue of targeting the right Flash player version.

Michael Brewer-Davis
Thank you, it works great with Flash Player 10.
zdmytriv
+1  A: 

You're probably not targeting Flash 10. In Project > Properties > Flex Compiler, make sure you've set either Require Flash Version: 10.0.0 (under HTML Wrapper -- yours may read 9.x.x) or otherwise specified the compiler argument -target-player=10.0.0. That ought to do the trick.

Christian Nunciato
Thank you, it works great with Flash Player 10.
zdmytriv