9 Replies Latest reply on Dec 17, 2008 11:07 PM by kglad

    Firefox getting error loading sound from server

    chopTheWood Level 1
      I'm using the following code to load some 30 sec soundbytes from a server. Safari works without error most of the time. When it fails it gives me a "webKiterrorDomain" message.

      Firefox just won't load anything ever.

      None of the 10 soundbytes refuse to load all the time with Safari. And the order in which I click on them doesn't seem to matter. Any at random will probably will load but 20% chance it might not.
        • 1. Re: Firefox getting error loading sound from server
          kglad Adobe Community Professional & MVP
          don't type my_sound insdie playSoundByte(): type it from the timeline containing that code.
          • 2. Re: Firefox getting error loading sound from server
            chopTheWood Level 1
            Nothing works now.
            I took out the "my_sound.start();"
            and put it in a frame which is referred to after the sound has loaded. I just get errors reported on the browser.


            function playSoundByte(byteName, dotLocation,theFrameName) {
            var my_sound:Sound = new Sound();
            my_sound.onLoad = function(success:Boolean):Void {
            if (success) {

            gotoAndPlay(theFrameName);

            } else {

            }
            };
            my_sound.loadSound(byteName,false);
            }
            • 3. Re: Firefox getting error loading sound from server
              kglad Adobe Community Professional & MVP
              why did you do that?
              • 4. Re: Firefox getting error loading sound from server
                chopTheWood Level 1
                Don't know why, thought that's what you were suggesting... Anyway, after some research and test trials I've decided that the ".onload" might not always get called into action (saw this conspiracy theory posted somewhere).
                So I decided to use the ol' getBytesLoaded / getBytesTotal trick instead. This worked much better, almost perfectly. Though every once in a while the same .mp3 that loaded earlier wouldn't load. I found that if I clicked on the link twice it would work. If not twice then surely the third time. This seemed to hold true for other .mp3s. So everything worked about 90% of the time but still..failures.

                I was using if (getBytesLoaded == getBytesTotal) which I figured maybe wasn't coming out exact all the time (has anyone ever tried this?). So I made the statement so they needed only to have a difference of 10 bytes (Math.abs). This seemed to solve the problem insofar as I've tested it in a limited way.
                I also found someone that claimed that Safari has a bug in it caused by the "enhancer"?? which yields an error something like "webkiterrorDomain..." when it fails to download a .pdf or, in my case, a .mp3

                that's the latest
                Chop
                • 6. Re: Firefox getting error loading sound from server
                  chopTheWood Level 1
                  Well, k, after using this for awhile now, I see that it's not perfect. Sometimes it takes two clicks on the same mc to actually play the sound play (but not always). Is the sound not loading in time for the start() function or what? So inconsistent.

                  What do you mean by your original response about placing the start()? Should it be in the mc that originates the call to the function(that loads the sound) on the main time line? I think I tried this unsuccessfully already.

                  I can't understand how inconsistently this works as I now have it. If it doesn't work after one click to the mc, the the second click almost always works.
                  rrrrrrrrr...
                  thanks, Chop
                  • 8. Re: Firefox getting error loading sound from server
                    chopTheWood Level 1
                    This is what I tried at the very first. It didn't work well so I tried the totalBytes / getBytes thing which seemed to work better. Then, because it didn't always work, I thought that perhaps there were times when the total bytes didn't exactly equal what was downloaded (can this be true?). So I gave it a range of error of 10 bytes by using the Math.abs() difference between the two. This worked okay but still not always. Currently, the first click, after clearing the cache in Firefox, usually doesn't play the sound. Clicking the same mc again usually does play the sound. Sometimes if I click sound "A" (doesn't work) then I click sound "B" (doesn't work), then I click "A" again it works. Sometimes clicking "A" twice (works) then click "B" once (works). Other sounds might work on the first try but often the first click on an mc after a cache empty will fail.

                    When I used the
                    IF (success) {
                    my_sound.start();

                    }

                    earlier I found that this sometimes never got to be true. I found this complaint elsewhere on the Internet.

                    Is this a Flash bug or browser bug? Safari is inconsistent as well but yields a "webKitErrorDomain203", though perhaps for a totally unrelated reason.. don't know.

                    Anyway.. any work around would be appreciated.
                    If you want to check it for yourself go to:
                    http://www.laurasiersema.com
                    then navigate to "music"

                    thanks, chop
                    • 9. Re: Firefox getting error loading sound from server
                      kglad Adobe Community Professional & MVP
                      works for me using firefox.