0 Replies Latest reply on Apr 18, 2007 11:07 AM by BSpero

    Multiple sounds, One sound object.

    BSpero Level 1
      What I want to do is load in a narrative, based on what a person is doing in a game. I create a sound object, load in a sound and play it. But, once the user does something, i want to stop that sound and start up another sound. I don't want to use stopAllSounds() because of sound effects and what not. I made a custom function. The way my head tells me this will work is that when I cue one sound, it will start playing, and if I cue another by calling playSound(), it will destroy the old instance (because it is stopping it and clearing it by creating a new sound with the same name) and start playing my new sound. What is wrong with my logic here?

      function playSound (mySound) {
      var narrationSound:Sound = new Sound ();
      narrationSound.attachSound (mySound);
      narrationSound.start ();