1 Reply Latest reply on Feb 27, 2007 6:45 AM by MajiDfn

    uploading a file on pressing submit

    mercl
      Hi,

      I'm new with actionscript 2.0,
      I found some great tutorials online on how to upload files using flash.

      works nicley, however,
      how can i select a file, continue to fill out a for and after submitting the form upload the files as wel.
      right now i got a listener that does this:

      MotfileListener.onSelect = function(file:FileReference):Void {
      file.upload(uploadPath);
      }

      I want it however only to upload AFTER pressing a main Submit Button elsewhere
      how do i do this, because now it starts uploading emmediatly after using the browse button.

      thanx i.a.
      ML
        • 1. uploading a file on pressing submit
          MajiDfn
          hi
          here is a sample code ....


          //browse_btn and upload_btn are Buton components
          browse_btn.addEventListener("click", showBrowse);
          upload_btn.addEventListener("click", doUpload);


          var imageFile:FileReference = new FileReference();
          imageFile.addListener(listener);
          //* show Browse *//
          function showBrowse(event:Object):Void {
          imageFile.browse();
          }
          //* Do Upload *//
          function doUpload() {
          imageFile.upload("uploadFILE.php");
          }


          let me know if you have any problem
          regards
          MajiD Fatemian