6 Replies Latest reply on Aug 24, 2006 5:52 AM by ballr2003

    saving SWF file

      I am building a digital catalog using a flip book component and delivering through IE on a CD. I want the user to be able to right-click an image and be able to save it to their local drive. I'm not delivering the final project on the internet and my FINAL catalog will be opened through IE.

      Any help and sample source coude would be greatly appreciated!!!
        • 1. Re: saving SWF file
          Are you trying to let the user actually save the swf file? Or just wanting them to be able to save an image file through the swf?
          • 2. Re: saving SWF file
            ballr2003 Level 1
            I want them to be able to save the swf file for viewing later. The document contains product info and they will reference it many times.

            • 3. Re: saving SWF file
              ballr2003 Level 1
              I found this action script to be able to right-click and save the swf file to my hard drive, but I think it has to be on a server. My project will not be on a server, but running from a CD or on someone's local machine. I'm not an action script person, so if you know how to modify, I would be EXTREMELY APPRECIATIVE!!!

              import flash.net.FileReference;
              var my_cm:ContextMenu = new ContextMenu();
              var menuItem_cmi:ContextMenuItem = new ContextMenuItem("Save SWF...", saveSWF);
              function saveSWF() {
              if (!fileRef.download(_url, saveName)) {
              error_txt.text = "dialog box failed to open.";
              this.menu = my_cm;
              //fileRef code
              var listener:Object = new Object();
              listener.onSelect = function(file:FileReference):Void {
              error_txt.text = "onSelect: "+file.name;
              listener.onCancel = function(file:FileReference):Void {
              error_txt.text = "onCancel";
              listener.onOpen = function(file:FileReference):Void {
              error_txt.text = "onOpen: "+file.name;
              listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
              error_txt.text = "onProgress with bytesLoaded: "+bytesLoaded+" bytesTotal: "+bytesTotal;
              listener.onComplete = function(file:FileReference):Void {
              error_txt.text = "onComplete: "+file.name;
              listener.onIOError = function(file:FileReference):Void {
              error_txt.text = "onIOError: "+file.name;
              var fileRef:FileReference = new FileReference();
              var saveName = _url.split('/').pop();

              Thank you!
              • 4. Re: saving SWF file
                Acorna Level 1
                Hmm well I haven't ever tried saving a swf from a flash document... I was going to suggest either using the getURL to link directly to the swf, or providing a link under the flash window in the page to have the download there... but if this is going to be run locally from a cd or at least from the user's local machine, won't they already have the swf files? I recently did a project for a cd (with or without internet connectivity)... which means that as long as the person has the cd (or transfers the file onto their local machine) they have access to it at anytime? Maybe I'm just miss-reading how your project works....
                • 5. Re: saving SWF file
                  NSurveyor Level 2
                  AFAIK, you can't modify my script to download a local file to the same computer.

                  Ycan use Flash Jester's JSystem:

                  but it's not a free solution...
                  • 6. Re: saving SWF file
                    ballr2003 Level 1
                    Acorna ,
                    You are correct in how your're reading the project, it's just that some people feel we need to spoon feed the users. If I use a getURL with a SWF file, it tries to open it in the browser and can't. The only thing I could figure is to zip the file, but I'm going to have space restraints on the CD because the number of documents will be around 300 with the number of pages being any where from 4 to 60.