I have control bar buttons Copy, Cut, and Paste and they suppose to copy/paste some text/objects from and to clipboard.
Copy/Cut works fine. Paste using CTRL+V and context menu works fine as well.
But when I'm trying to access Clipboard via control bar button click handler it throws 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 that this is security issue.
Method Clipboard.generalClipboard.getData() may be used to read the contents of the system Clipboard, but only when it is called from within an event handler processing a flash.events.Event.PASTE event.
But I have to implement paste control bar button. Had do I do that?