views:

14

answers:

0

[[Cross posting from the Adobe AIR forums: (http://forums.adobe.com/thread/707440?tstart=0)]]

Hi all,

I'm developing an HTML/JavaScript based AIR 2.0.3 desktop application where I want to make use of the File Promises APIs. Here's what my code looks like:

var cb = new air.Clipboard(), promises = []; for(var i = 0, l = this._urls.length; i < l; i++) { var fp = new air.URLFilePromise(); fp.request = new air.URLRequest(this._urls[i].url); fp.relativePath = this._urls[i].fileName; promises.push(fp); } cb.setData(air.ClipboardFormats.FILE_PROMISE_LIST_FORMAT, promises); air.NativeDragManager.doDrag(window.htmlLoader, cb);

So, I can pop a few urls into the clipboard and have them download to the local file system when the user drags an few files out of my AIR application.

Here's what I'd like to be able to do though:

While the user is dragging the files out of my AIR application, I'd like to be able to cancel the dnd operation to prevent them from dropping them based on certain criteria. Is there any way to do this? I tried invoking the air.NativeDragManager.dragInitiator.stopDrag method, but no luck there. I tried dispatching a NATIVE_DRAG_COMPLETE event to try to trick the NativeDragManager into thinking that the drag operation had stopped, but no luck there either.

Anyone any ideas on this

Cheers

Sean

related questions