0 Replies Latest reply on Dec 6, 2007 12:33 PM by evsPeart

    browseForOpen and then copyTo...??

    evsPeart Level 1
      Hi,

      I want to browse a image and then copy the selected image in a new folder, I was trying with this code, but when I do it the copy action always override the destination folder. But I want to copy the image inside a folder.

      private function OpenImage():void
      {
      var imageFilter:FileFilter = new FileFilter("Images", "*.jpg;*.gif;*.png;*.swf;");
      imageFile = new File();
      imageFile.browseForOpen("Select an image", [imageFilter]);
      imageFile.addEventListener(Event.SELECT, imageSelected);
      }

      private function imageSelected(event:Event):void
      {
      filePath = new File();
      var filePath:File = File.applicationResourceDirectory;
      filePath.nativePath += "\\galleries\\flextravel\\";
      imageFile.copyTo(filePath, false);
      Alert.show("Click", 'Alert Box', mx.controls.Alert.OK);
      }