4 Replies Latest reply on Dec 19, 2007 12:11 PM by funkymartian

    Download button

    funkymartian
      I was wandering if anyone knew of a way to create a download button in flash? Is there a tuturial or something I can see how to do it?

      I have an upload button and that works. What we want the client to do is to click the download button and have an option that will allow the user to download files from the server.

      Any help would be appreciated.

      Thanks.
        • 1. Re: Download button
          exPluda? Level 1
          button.onRelease = function() {
          getURL("some_url/some_file.zip");
          }

          to make this dynamic you can make

          var what_file:String = _root.ffile.text;
          //
          button.onRelease = function() {
          getURL("some_url/"+what_file+".zip");
          }

          assuming you have one textfield with instance name ffile
          • 2. Re: Download button
            funkymartian Level 1
            Pluda,

            Thanks for the reply. That is what I originally did. But they don't want that. They want something like, after the user login, the next screen will be a user interface. The interface has an upload button that allows the client to upload their CAD files to the server. Then after we do whatever to their CAD files, we load it back onto the server. The user then can click the download button, look at what file they want onto the server, then click the file to download it.

            Plus a standard contact form.

            I guess this would be similiar to a content management system.

            I just wasn't sure if that was possible in AS2. I have the contact forms and the upload working. It's just this download thing that is throwing me for a loop. I think I will tell them that the clients can upload, once were done, we can send them a link to their download.

            Thanks for the help again.
            • 3. Re: Download button
              exPluda? Level 1
              ok,

              so when user gets back to your app, he presses one button and you should load a php or asp or whatever who is going to retrieve from your database the names of the files you have for him to download.
              for each you just make one <a href> and its ok

              something like

              I do the login

              You can use my login username to define what I can listen in your server
              If you use mysql you just have to query database for "select project from database where client like'".$GET['username'];

              then you send back to flash your query result and populate one datagrid ou tree ou whatever you want with links to download
              • 4. Re: Download button
                funkymartian Level 1
                That's a good idea, but I found a different way than using mysql. Since we use the servers for everything, I made a txt file with the url of the download. I or somebody just updates the txt file when the user's download is ready. It loads into the Flash Interface using a dynamic text field.

                Thanks for your help! I appreciate it!