2 Replies Latest reply on Aug 5, 2008 7:40 AM by chrisatflash

    loading external JPG files

    chrisatflash Level 1

      I am trying to load external jpg files. Everything goes well, but sometimes the extension
      of a file is not ".jpg" but ".JPG" (in capitals). I have to manually rename the files to the lowercase.

      Is there a smarter way to load a jpg (without being dependend when the extension is in capitals?)

      something like:

      pathFile = "picture "+ picCounter+".jpg";

      if(pathFile == undefined) {
      pathFile = "picture "+ picCounter+".JPG";


        • 1. Re: loading external JPG files
          Shandy Elliott Level 1
          I've noticed when transferring images from a camera to the computer, the file extension is usually .JPG. That may be a setting somewhere on my camera, but I'm not concerned about it. Once I edit a photo and save it, the extension then becomes .jpg. If I need to load any unedited images that have the uppercase extension, I use Adobe Bridge to do a batch rename by just changing the extension to lowercase. This is the fastest way for me. Your code might work the way you have it, but I think you would have to add something like loader.onLoad and check to see if flash returns a "success" value, if so, then you would know the extension is correct, then do an else statement if "success" isn't returned by loading the uppercase extension. This is all off the top of my head, so don't quote me.
          • 2. Re: loading external JPG files
            chrisatflash Level 1
            I was thinking the same. I will try and something with onLoadError
            Thanksfor your opinion.