Paste text from clipboard using button

I have buttons on the Copy, Cut, and Paste control panels, and they suggest copying / pasting text or objects from the clipboard and to the clipboard.

Copy / Cut is working fine. Insert using CTRL + V and the context menu is also great.

But when I try to access the buffer through the click handler in the control panel, it throws an error

SecurityError: Error #2179: The Clipboard.generalClipboard object may only be read while processing a flash.events.Event.PASTE event.
at flash.desktop::Clipboard/getObjectReference()
at flash.desktop::Clipboard/convertNativeFormat()
at flash.desktop::Clipboard/getOriginal()
at flash.desktop::Clipboard/getData()
... 2 more

I know this is a security issue.

The Clipboard.generalClipboard.getData () method can be used to read the contents of the system clipboard, but only when it is called from the event handler handling the flash.events.Event.PASTE event.

But I have to enter the paste control panel button. Did i do that?

+5
4

, Flash Player, Flash Local shared, http://joeberkovitz.com/blog/2008/12/12/clipboard-using-local-shared-objects/ Javascript API ExternalInterface .

+2

, , - . , . "" , , , - , - , . , - , ?

UPDATE: , . , , Clipboard.generalClipboard.setContents - , "" (ctrl + V ). .

+1

, , , , . ?

0

To avoid exception protection, the event target MUST be the object of an application phase. I did not find this information in any documentation, this is from my own experience. Hope this works.

-1
source

All Articles