dinsdag, oktober 09, 2007

Adobe AIR: Beta 2 drag and drop + window

Adobe released the beta 2 for AIR.

There have been some changes in the API. So if you did some projects in beta 1 you will have to change your code.

window is replaced by nativeWindow. For example:
stage.window.x is now stage.nativeWindow.x

The drag and drop API has been changed dramatically:

The classes TransferableFormats and TransferableData are gone.
You will now have to use the Clipboard and ClipboardFormats classes.
Dragging in for example:

import desktop.Clipoard;
import desktop.ClipboardFormats;

private function onDrop(e:NativeDragEvent):void {

DragManager.dropAction = DragActions.COPY;

var dropfiles:Array = e.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;


So to sum it up:

1. use clipboard.getData instead of transferable.dataForFormat.
2. use ClipboardFormats.FILE_LIST_FORMAT instead of transferableFormats.FILE_LIST_FORMAT

Take care!

Geen opmerkingen: