DraggenDroppen allows you to drag and drop files from the local file system to Flash. It uses a Javascript bridge to make the communication between the Flash content and the page where it is inserted.

It only works in a capable browser environment.


public function DraggenDroppenDemo()
    dd = new DraggenDroppen();
    dd.addEventListener(DraggenDroppenEvent.DRAG_OVER, dragOverHandler);
    dd.addEventListener(DraggenDroppenEvent.DRAG_LEAVE, dragLeaveHandler);
    dd.addEventListener(DraggenDroppenEvent.FILE_START, fileStartHandler);
    dd.addEventListener(DraggenDroppenEvent.FILE_PROGRESS, fileProgressHandler);
    dd.addEventListener(DraggenDroppenEvent.FILE_COMPLETE, fileCompleteHandler);

    // dd.isSupported (Boolean)
    // Whether or not DraggenDroppen is supported by the browser

private function dragOverHandler(event:DraggenDroppenEvent):void {
    // User is dragging files:
    // Mouse pointer is over the SWF

private function dragLeaveHandler(event:DraggenDroppenEvent):void {
    // User is dragging files:
    // Mouse pointer left the SWF

private function fileStartHandler(event:DraggenDroppenEvent):void {
    // One of the dropped files starts transferring

private function fileProgressHandler(event:DraggenDroppenEvent):void {
    // One of the dropped files is transferring

private function fileCompleteHandler(event:DraggenDroppenEvent):void {
    // One of the dropped files completed transferring
Misc . URL.