7 Replies Latest reply on Feb 14, 2007 1:40 PM by ScottE

    Display JPEG in Browser from Flash

    ScottE
      Hi All,

      I'm working on a Flash project that will be distributed via CD or DVD. I need to include several jpegs in the Flash file that can be opened in the user's browser by a simple mouse click when the user runs the Flash program from their CD/DVD player.

      Any help would be much appreciated. I'm a nOOb and need help!

      Many Thanks,
      Scott
        • 1. Re: Display JPEG in Browser from Flash
          SymTsb Level 2
          this.getURL(imagename.jpg, _blank);
          • 2. Re: Display JPEG in Browser from Flash
            ScottE Level 1
            Thanks for the code but I get an error message. When I click on the image that I want opened up in the browser from the Flash file i get this error message:

            Cannot find 'file:///E|/undefined'. Make sure the path or Internet address is correct.

            My CD/DVD drive is E. I want my user's to be able to load the image into their browser from the CD that has the Flash file regardless of their drive designation.

            Any ideas?

            Many thanks,
            Scott
            • 3. Re: Display JPEG in Browser from Flash
              Juankpro Level 2
              dont forget the quotation marks

              this.getURL("imagename.jpg", "_blank");
              • 4. Re: Display JPEG in Browser from Flash
                ScottE Level 1
                Thanks! I added the quotations but I still get the same error message.
                I did discover this works if I copy the jpg directly onto the CD but I don't want to do that.

                I was hoping to have the jpg within the Flash projector and just simply call it up from there into the browser.

                Your help is greatly appreciated and I hope to hear your ideas on this soon.

                Scott
                • 5. Re: Display JPEG in Browser from Flash
                  SymTsb Level 2
                  unless you import the image to the stage, an image will never be included inside the flash file. If that is what you want though, it would work something like this...

                  Import all of your art work (jpgs etc) to the library. Create a movie clip which contains x number of frames where x is the total number of art work items you want to show. On each frame of your clip, place a single image that you want shown.

                  Drop this clip on the stage and name it images or something similar. My code below will reflect a name of images....

                  Now instead of calling getURL from your button, you'd instead do a
                  images.gotoAndStop(X);
                  where x is the number of the frame the image you want shown resides. This method won't use a web browser instead it will show the image inside the projector.

                  If you absolutely insist on it opening the image in safari or IE or Mozilla, you will need to include the images on the CD or if you can guarantee that the clients seeing this will indeed have an internet connection, you can place the images online and then use getURL to direct them to that location instead. There are numerous options, but each has it's pros and cons.

                  Since this is a kiosk, this should not present any issues. If you want to post this on the web though, at some future date, I'd choose to use one of the two different getURL options since they provide the greatest amount of flexibility.
                  • 6. Re: Display JPEG in Browser from Flash
                    Juankpro Level 2
                    Yep
                    images imported directly to flash cannot be "exported" out of flash in a browser.
                    • 7. Re: Display JPEG in Browser from Flash
                      ScottE Level 1
                      Many thanks to all. I appreciate the help and am moving forward based on your input and direction.

                      Scott