4 Replies Latest reply on Feb 11, 2008 7:22 AM by rafa@mediatech

    Creating a download link

    vmansx Level 1
      Hello im creating a cd rom that has numerous videos and swf files included on the cd. Im wanting a normal text link on a page that says "download animation" this link then needs to be able to download animations(swf format) or quick time videos to the users computer in the same way that you get a save as option over the internet, can anyone please help i know its probably a simple task but i cant think of the process.
        • 1. Re: Creating a download link
          rafa@mediatech Level 1
          Hello vmansx:
          I use the same feature for a customer in a lot of his projects. In his case he wants the .pdf files to be saved on the user' s desktop. I use the buddy api xtra for the following code.

          The "FOLDER" is the name of the folder you want created in the desktop. The "RESOURCE\NAME_of_FILE" is where your file is located on your disc. The second "FOLDER\NAME_of_FILE" is saying where you want your file copy to, which is to the "FOLDER" you just created on the desktop. I have not tried this with anything other than .pdf and .doc files, but I am sure it will work with videos.
          Hope this helps! Good Luck!

          • 2. Re: Creating a download link
            vmansx Level 1
            hey thanks for the reply i have followed your instructions and have downloaded the xtra for the mac but can you test the download link before its published to cd and were do you put the xtra is it just in the xtras folder in the apllications xtra folder
            • 3. Re: Creating a download link
              vmansx Level 1
              I have just tested the projector (mac) and the code works and creates a folder but does not copy the file to the destination it is empty. 1: am i using the xtra correctly and 2: is the code im using correct (below) thanks

              on mouseup me
              Answer = baMsgBox( "The animation file will now be copied to your desktop.", "A question" , "OKCancel", "Question" , 1 )
              if Answer = "OK" then
              desk = baSysFolder( "desktop" )
              ok = baCreateFolder( desk&"Video_1" )
              oK = baCopyFile( the moviepath&"test_versions\Flow chart 1" , desk&"FOLDER\Video_1" , "IfNewer" )
              alert "The animation was successfully copied to your desktop."
              end if
              • 4. Creating a download link
                rafa@mediatech Level 1
                I am sorry, the code I gave you works on PC. I have not tested it on Macs...for instace, I know that in the places I have " / " you would need to replace it with " : " for it to work on Mac. But I am not sure if you refer to the Mac desktop as "desktop " like in the code. The xtra needs to go on your xtras folder. It is located inside your "applications" folder. Once you put the xtra in your xtras folder, you need to embed the xtra with your project by going to "modify>movie>xtras." Like I said, I use Director 99.9% of the time for PC...I am not familiar on how to incorporate this code with the Mac version.

                Change the " / " to " : " and see if that fixes the issue...let me know.