1 Reply Latest reply on Nov 19, 2007 1:56 AM by walendo

    The Sound class - loads a sound fine, but no sound plays!

    ZClaes
      Hey all - I'm trying to use the Sound() class to load and play a sound. No errors are thrown and everything appears to work fine (and my speakers are on) but I hear no sound! Is there anything I could be missing?

      Code snippet:

      var s:Sound = new Sound();
      s.addEventListener(Event.COMPLETE,OnSoundLoaded);
      s.load(new URLRequest(sound_file));

      private function OnSoundLoaded(e:Event):void
      {
      var sound:Sound = e.target as Sound;
      var channel:SoundChannel = sound.play();
      }

      So, the OnSoundLoaded function is called fine - no IO error occurs or anything - and the channel variable is not null. However, no sound is played. I've tried loading this same sound file in a flash sound player made by someone else, and the sound played fine, so it's not a problem with the file itself.

      Any ideas?
      Thanks!