6 Replies Latest reply on Oct 21, 2013 3:30 PM by TimJaramillo

    How to stop sound

    Pawelkkk

      Hi folks,

       

      I just wonder maybe someone here may help me. I have imported buzz.js in to my edge project and created a click event on my timeline. So when you click on button this function will run and play a sound.

       

      var phoneSound = new buzz.sound( "audio/phoneCar", {

                  formats: [ "ogg", "mp3", "acc" ]

              });

          phoneSound.play()

          phoneSound.loop()

          .fadeIn()

          .bind("timeupdate", function(){

          var timer = buzz.toTimer(this.getTime());

          document.getElementById("time").innerHTML =timer;

          });

       

      And now I dont know how to stop this sound when I click on another button. I created another button with click event and phoneSound.stop(); inside, but no luck.

       

      Dev version http://pawelkaim.com/web/