5 Replies Latest reply on Jul 7, 2009 9:49 AM by 72dolphins

    Opening images via Flash

    72dolphins

      Hello-

      I have a Flash .exe built that will be distributed via CD. The purpose of the presentation is to allow users to download desktop wallpapers. The Flash contains three thumbnails, that when clicked, should open the wallpaper file from the CD itself.

       

      As of right now, I have it set up so that images open into the user's default browser via a button with a getURL action. They can then right click in the browser and download the image they want.

       

      I am curious to know if this is the best method for handling the opening of the images from Flash and the subsequent saving of the images to a user's computer.

       

      If there is another method that may be better, your help would be much appreciated.

       

      Thanks,

      Mike

        • 1. Re: Opening images via Flash
          kglad Adobe Community Professional & MVP

          you can use the file reference class but you'll need to direct users to download the file (from your cd) to the directory where they want the wallpaper saved.

           

          and this may not be doable unless you create an air app.

          1 person found this helpful
          • 2. Re: Opening images via Flash
            72dolphins Level 1

            Thanks for your help... This got me started, but nothing seems to be happening when I click on the thumbnails. I have been looking around for what could be the error, but no luck. If anyone can point me in the right direction or where I may have gone wrong, I would appreciate it greatly!

             

            Here's a sample of the code I am using:

            FYI - On my timeline, the button has an instance name of "oneBtn". The desktop wallpaper file name is "SaveTheDate_Westin.jpg" and is in the same directory as the .exe file on the CD.

             

             

            import flash.net.FileReference;

             

            var fileRef:FileReference = new FileReference();
            fileRef.addListener(listener);

             

            var url:String = "SaveTheDate_Westin.jpg";

             

             

             

            oneBtn.onRelease = function() {
                if(!fileRef.download(url, "SaveTheDate_Westin.jpg")) {
                trace("dialog box failed to open.");
            }
            }

            • 3. Re: Opening images via Flash
              kglad Adobe Community Professional & MVP

              i still don't see a way clear to use this outside of an air app but you can get the dialogue box to open using:

               

               

               

              import flash.net.FileReference;

               

              var fileRef:FileReference = new FileReference();
              fileRef.addListener(listener);

               

              var url:String = "http://localhost/pathtoimage/SaveTheDate_Westin.jpg";

               

               

               

              oneBtn.onRelease = function() {
                  if(!fileRef.download(url, "SaveTheDate_Westin.jpg")) {
                  trace("dialog box failed to open.");
              }
              }

              • 4. Re: Opening images via Flash
                72dolphins Level 1

                So, there is essentially no way to acually get the files to actually save to a user's hard drive outside of building an AIR app or using a third party tool?

                 

                Is using the getURL method still my best choice outisde of that?

                 

                Thanks again for your insight and help.

                • 5. Re: Opening images via Flash
                  72dolphins Level 1

                  PS, the only reason I have brought up alternative methods for saving the files is because my client mentioned that she had to do the following:

                   

                  When I clicked on the first image, internet explorer came up and opened the image. But, when I clicked on the 2nd and 3rd images, I had to press "escape" and go to internet explorer in order to see the images.

                   

                   

                  Thanks again.