1 Reply Latest reply on Sep 1, 2010 7:17 AM by Neobox75

    Dragging a file to a Mac creates an alias

    ida_raski

      Hi all,

       

      I have a desktop application which allows the user to drag a PDF file from it to the desktop.

      When the file is copied, the original one in the app-storage gets deleted.

      Everything works fine on Windows, but on Mac when dropped an Alias file is created and deleted when the original file gets deleted.

      How can I solve this?

       

      This is my code:

      private

       

       

       

       

       

      function dragStart(event:MouseEvent):void

      {

       

       

           var fileArray : Array = new Array();

           fileArray.push(myFile);

       

           var clip:Clipboard = new Clipboard();

           clip.setData(ClipboardFormats.FILE_LIST_FORMAT, fileArray);

       

       

           var dragOptions:NativeDragOptions = new NativeDragOptions();

           dragOptions.allowCopy =

      true;

           dragOptions.allowLink =

      true;

           dragOptions.allowMove =

      false;

       

           NativeDragManager.doDrag(event.currentTarget

      as InteractiveObject, clip, null, null, dragOptions);

      }

       

      protected function dragComplete(event:NativeDragEvent):void {

       

      if (event.dropAction != "none")

      {

           refreshAndGoBack();

      }

       

      else

      {

       

       

           Alert.show("The file could not be dropped", "Fault");

       

      }

      }

       

       

      private function refreshAndGoBack():void

      {

       

       

           //Delete the file from the local store folder if the drop action was successfull

       

       

           var item:File = new File("app-storage:/" + myFile.);

           item.deleteFileAsync();

      }

       

      Thanks in advance.