1 Reply Latest reply on Oct 4, 2010 3:35 PM by IptamenosOllandos

    load another sound in the same sound object

    IptamenosOllandos Level 1

      Hi,

      I am loading a sound like this:

      public var smallSound:Sound = new Sound();
      public var trans1:SoundTransform = new SoundTransform(1, 0);
      public var channel:SoundChannel = new SoundChannel();
      smallSound.load(new URLRequest("firsttrack.mp3"));
      channel=smallSound.play(0,1,trans1);
      

       

      When an event occurs (button click actually) I would like to stop playing the first sound and playing another sound in the same object. So I try doing this:

      smallSound.load(new URLRequest("secondtrack.mp3"));
      channel=smallSound.play(0,1,trans1);
      

       

      but it does not work. The first sound keeps playing. I havent understood something probably.. Can someone help me ??