Well I was just doing some audio book organising and realised that it would be great if I could drag and drop a folder straight from my AIR into iTunes ready for upload to my iPhone.

Anyways after a little searching through the docs I came up with this little ditty:

var cp : Clipboard = new Clipboard();
cp.setData(ClipboardFormats.FILE_LIST_FORMAT, [new File(book.url)], false);
NativeDragManager.doDrag(null,cp);

Which gets fired by my DataGrid in the view:


<mx:DataGrid width=”100%” height=”100%” dataProvider=”{books}” editable=”true”

itemEditEnd=”{dispatchEvent(new BooksEvent(BooksEvent.PROPERTY_CHANGED));}”

dragEnabled=”true”

dragStart=”{dispatchEvent(new BooksEvent(BooksEvent.BOOK_BEGIN_DRAG, AudioBookModel(event.currentTarget.selectedItem)))}”>

Its pretty cool.

Anyways, the latest version and the source is below: