Skip to main content
Known Participant
Dec 21, 2022 8:56 PM UTC
Question

Stop and Play Sound from one button

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 is closed to new replies. Start a new post to keep the conversation going.

    53 replies

    kglad
    Community Expert
    Community Expert
    Dec 21, 2022 8:59 PM UTC

    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.

    Translate
    Known Participant
    Dec 21, 2022 9:02 PM UTC

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

    Translate