views:

24

answers:

1

TextField objects have a built in context menu containing items which target cut, copy, paste, delete and select all events.

i would like to map keyboard keys and modifiers to these events to obtain their free functionality.

is that possible?

A: 

from the documentation (InteractiveObject Class):

TextField objects do not dispatch clear, copy, cut, paste, or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu. You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands (or their keyboard equivalents) does not generate clear, copy, cut, paste, or selectAll events. However, other classes that extend the InteractiveObject class, including components built using the Flash Text Engine (FTE), can dispatch these events.

in AIR, it's mind-numbingly simple to accomplish this, as they are built-in public methods of the NativeApplication class.

NativeApplication.nativeApplication.cut();        //Cut
NativeApplication.nativeApplication.copy();       //Copy
NativeApplication.nativeApplication.paste();      //Paste
NativeApplication.nativeApplication.clear();      //Delete
NativeApplication.nativeApplication.selectAll();  //Select All
TheDarkInI1978