views:

24

answers:

1

Textfields currently do not dispatch paste events. When the user is using keyboard shortcuts to paste, there's a way to workaround that shortcoming by listening to various keyboard events in the textfield.

Is there a way to detect the paste event when it is originated from a click on the ContextMenu?

A: 

When you choose an item in a ContextMenu, the chosen ContextMenuItem dispatches a menuItemSelect event. Use that.

Robusto
I just can't get a reference of the default contextMenu in order to add an event listener. I've tried a lot. Would you be so kind and provide a working example?
fusion
Oh, I see what you're asking now. Can't you just listen for the `paste` event in the TextInput? According to Adobe, it is: *Dispatched when the user activates the platform specific accelerator key combination for a paste operation or selects 'Paste' from the text context menu.*
Robusto
fusion
Hmm ... I just tested it and you're right. The docs say it should, and the code completion on the TextInput in MXML even offers "paste" as a valid event to listen for. But the handler doesn't get called. Bummer.
Robusto