Play/stop sound in adobe animate html5 canvas document
Hello,
I wanted to know if there is any way to make this AS3 code work in HTML5 document?
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToPlayStopSound_3);
var fl_SC_3:SoundChannel;
var fl_ToPlay_3:Boolean = true;
function fl_ClickToPlayStopSound_3(evt:MouseEvent):void
{
if(fl_ToPlay_3)
{
var s:Sound = new Sound(new URLRequest("http://www.helpexamples.com/flash/sound/song1.mp3"));
fl_SC_3 = s.play();
}
else
{
fl_SC_3.stop();
}
fl_ToPlay_3 = !fl_ToPlay_3;
}
