Skip to main content
Participant
May 31, 2022
Question

audio wont stop when i click button please help

  • May 31, 2022
  • 2 replies
  • 89 views

[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;

 

 

This topic has been closed for replies.

2 replies

Nancy OShea
Community Expert
Community Expert
May 31, 2022

Action Script??  Gosh, I hope you're not using Flash.

 

Nancy O'Shea— Product User & Community Expert
Peru Bob
Community Expert
Community Expert
May 31, 2022

This is the Using the Community forum (which is the forum for issues using the forums).
Please tell us what Adobe application you are using so that this can be moved to the proper forum for help.