0 Replies Latest reply on Jan 12, 2011 4:44 AM by pbrudlo

    Air Web browser with drag out remote files

    pbrudlo

      Hi

       

      I'm new in AIR so I have few questions.

      I want to create my own simple web browser where users can drag out files on desktop using links on web pages instead of normal OS download system.

      I've found function which works fine when I use static url and name but I don't know method how I can actually get real url and name.

       

      Method:

                   addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

                   public var fileDown:URLFilePromise;

                   public function mouseDownHandler(event:MouseEvent):void
                   {

                      fileDown = new URLFilePromise();
                      fileDown.request = new URLRequest("http://www.example.com/file.txt");
                      fileDown.relativePath = "file_name.txt";
                      var promises:Array = new Array();
                      promises.push(filePromise);
                      var clipboard:Clipboard = new Clipboard();
                      clipboard.setData(ClipboardFormats.FILE_PROMISE_LIST_FORMAT, promises);
                      NativeDragManager.doDrag(this, clipboard);

                }

       

       

      Can anyone help with this ??