Copy link to clipboard
Copied
Giddayguys
Just researching the drag and drop capabilities of AS3 in Air, specifically dragging data out of an AIR app into a non air app. Do you have any control over what happens to the data after getting to the non-Air app? eg if I click a datagrid in AIR, and it copied text from the column to the clipboard, and then I drag out of AIR into, say, Windows notepad, can I paste the clipboard's data by dropping?
Thanks
Wow I thought flash.desktop was all AIR, my mistake, thanks for the info as always kglad!
And #8 is still correct, there is no simple interface from AIR via drag and drop to another app. The main reason is other apps need to be programmed to even receive the win32 message and know how to handle it. Some apps may allow it but you must abide by their API to accomplish that. Less you make a win32 ANE, the chances are the simple answer to your question is no, that is not possible (for good reasons).
Copy link to clipboard
Copied
you can paste the code by using the os paste command(s).
Copy link to clipboard
Copied
How would you hook that paste command into any external app the user drops the drag into? I'm very familiar with internal and external->internal drag and drop but I haven't seen any native support or ANEs for AIR to interface with other processes running in such a way so I'd like to know how to use the OS paste commands to paste into the "dropped" app. My initial impression was this isn't possible without some serious (perhaps impossible) ANE extension. Win32 to win32 messaging is pretty easy but I'd love to know if I missed something built into AIR for this.
Copy link to clipboard
Copied
anything saved to the clipboard (and flash can save to the clipboard) is available to the os paste command. there's no drag/drop from/to the clipboard so that part makes no sense.
Copy link to clipboard
Copied
Care to elaborate on what you mean by there's no drag and drop to the clipboard or where that fits? And flash cannot save to the clipboard itself unless I am wildly mistaken.
Copy link to clipboard
Copied
check the as3 clipboard class: flash can both read and write to the clipboard:
import flash.desktop.ClipboardFormats;
var s:String = "flash to clipbaord";
Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, s);
// your next os paste will be "flash to clipboard"
Copy link to clipboard
Copied
Yeah - I've just been using:
var my_datagrid_row = Number(event.rowIndex)
System.setClipboard(my_datagrid[my_datagrid_row]["FRUIT"]);
...in the click function for my datagrid called by:
my_datagrid.addEventListener(ListEvent.ITEM_CLICK, my_datagrid_clicked);
It copies the data from that row/column by clicking it, ready for manual pasting wherever, but I was wondering if this could be converted to a drag and drop to a non AIR app?
Copy link to clipboard
Copied
Yeah setting clipboard wasn't what I'm talking about kglad, that is simple. Making it useful in any [insert random application] is the challenge. You can't just take the clipboard and dump it in another app without some win32 programming.
Copy link to clipboard
Copied
no, as i mentioned in my first two responses, you have to "paste" the clipboard contents into your app. though, if your app is coded to read the clipboard or you add that code like sinious mentioned in 7 you're good.
but clearly there's nothing you can encode in app1 (eg, a flash app) that would enable some functionality in an unrelated app2.
Copy link to clipboard
Copied
Wow I thought flash.desktop was all AIR, my mistake, thanks for the info as always kglad!
And #8 is still correct, there is no simple interface from AIR via drag and drop to another app. The main reason is other apps need to be programmed to even receive the win32 message and know how to handle it. Some apps may allow it but you must abide by their API to accomplish that. Less you make a win32 ANE, the chances are the simple answer to your question is no, that is not possible (for good reasons).
Copy link to clipboard
Copied
Thanks guys. Confirmed my suspicions. And it makes sense.
Copy link to clipboard
Copied
You're welcome and good luck!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now