7 Replies Latest reply on Jan 16, 2017 5:33 PM by ClayUUID

    Play audio onClick

    jackh8500410 Level 1

      Hi,

       

      I've been trying to get some music to play when the user clicks (its for a mute and unmute button)

      I've got the mute button to work with the stop all sounds code snippet. I tried to adapt it and this is what I have:

       

      //unmute sound

      instVolOn.addEventListener(MouseEvent.CLICK, Unmute);

       

      function Unmute(event:MouseEvent):void

      {

        SoundMixer.Playl(welcomeMusic.mp3);

      }

       

      Safe to say it didn't work, can someone help?

       

      Thanks,
      Jack