audio wont stop when i click button please help
[Moderator moved from Using the Community (forums) to Animate.]
i put action script on a button "click to play/stop sound" but when I try it, it wont stop the audio when I click it and it shows an error please help!!
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at activity4_fla::MainTimeline/fl_ClickToPlayStopSound_12()
this is my code:
audioturnon.addEventListener(MouseEvent.CLICK, fl_ClickToPlayStopSound_12);
var fl_SC_12:SoundChannel;
//This variable keeps track of whether you want to play or stop the sound
var fl_ToPlay_12:Boolean = true;
function fl_ClickToPlayStopSound_12(evt:MouseEvent):void
{
if(fl_ToPlay_12)
{
var s:Sound = new Sound(new URLRequest("animalcrossingaudioClass.wav"));
fl_SC_12 = s.play();
}
else
{
fl_SC_12.stop();
}
fl_ToPlay_12 = !fl_ToPlay_12;
