Skip to main content
Known Participant
December 21, 2022
Question

Stop and Play Sound from one button

  • December 21, 2022
  • 1 reply
  • 1786 views

This is my code where it can only stop. I want to make it play the song back can anyone help ?

 

silence.addEventListener(MouseEvent.CLICK,onStop);
function onStop(e:MouseEvent):void{
SoundMixer.stopAll();
silence.visible=false;
}

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    December 21, 2022

    what's the code used to start the sound? or, if it's timeline sound, it needs to be in a movieclip (generally) with nothing else.

    Known Participant
    December 21, 2022

    mpi.suara("bgm", "loop", 10);
    mpi.aturSuara("onOff");