1 Reply Latest reply on Apr 8, 2009 7:23 PM by kglad

    Flash sound skipping problem

      When using Firefox 3.0.8 - as the site starts up, the music plays a couple of notes of song 1, stops and then restarts song 1; giving a "skipping" effect.

      When using IE 7.0.5730.13-  as the site starts up, the music plays a couple of notes of song 1, stops and then starts song 2; giving a worse "skipping" effect.

      This only happens when the site starts up. Once the music is playing it cycles through the songs just fine. The play/pause button works fine too.

      What am I doing that is causing this behavior? Help?

       

      I am using Flash CS3, ActionScript 2.0, the songs are in the same folder as the .swf and are named music1.mp3, music2.mp3, music3.mp3.

       

      Here is what I have in frame 2 on the script layer:

      ------------------------------------------------------------------------------------------

      var mysong = new Sound();

       

      _root.mysong.onLoad = function (loadedOK) {
      if(loadedOK) {
          _root.mysong.start(0,1);
        }
      }

       

      _root.mysong.onSoundComplete = function () {
          nextSong(1);
      }

       

      currentSong = 0;
      maxSongs = 3;
      function nextSong (changeVal) {
          currentSong += changeVal;
          if (currentSong > maxSongs) {
              currentSong = 1;
          }
          _root.mysong.loadSound("music"+currentSong+".mp3", true);
         
      }

       

      nextSong(1);

      ------------------------------------------------------------------------------------------ --------------

      Code in frame 1 (play) of the volume control movie:

       

      stop();
      _root.mysong.start(playHeadPos/1000,1);

      ------------------------------------------------------------------------------------------ ------------------

      Code in frame 2 (pause) of the volume control movie:

       

      stop();
      playHeadPos = _root.mysong.position;
      _root.mysong.stop();