Flex: how to prevent PASTE (ctrl + V) in flex3 textinput?

Hi I need to disable text insertion in textinout (flex3): CTRL + V Any idea?

Reagrds

+4
source share
2 answers

This block only inserts more than one letter, but it works for most purposes:

<mx:TextInput textInput="if (event.text.length > 1) event.preventDefault()"/> 

and for the spark:

 <s:TextInput change="if (event.operation is PasteOperation) (event.target as SkinnableTextBase).text = '' " /> 
+5
source

I am afraid that you cannot use TextInput:

TextField objects are not sent to clear, copy, cut, paste, or select All 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 equivalent) does not generate transparent, copy, cut, paste, or select all events. However, other classes that extend the InteractiveObject Class, including components created using the Flash Text Engine (FTE), will send these events in response to user actions such as keyboard shortcuts and menu contexts.

There is a workaround: How to stop copy / paste in a flash form

0
source

Source: https://habr.com/ru/post/1346450/


All Articles