Uli
Uli

Reputation: 2693

Adobe Air - Paste image via context menu

Is there a way to copy an image into an Air app through the context menu (right-click menu) or at least to detect if there is an image within the clipboard?

Thanks Uli

Upvotes: 1

Views: 309

Answers (1)

merv
merv

Reputation: 76850

One strategy would be to check the clipboard on the ACTIVATE event and do something like enable/disable a context menu item based on the result:

private function checkForImageData(e:Event):void {

  myContextMenu.clipboardItems.paste = Clipboard.generalClipboard.hasFormat(ClipboardFormats.BITMAP_FORMAT);

}

addEventListener(Event.ACTIVATE, checkForImageData);

Upvotes: 1

Related Questions