Skip to main content
Participant
May 31, 2022 5:26 PM UTC
Question

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;

 

 

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Nancy OShea
Community Expert
Community Expert
May 31, 2022 9:51 PM UTC

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

 

Translate
Nancy O'Shea— Product User & Community Expert
Peru Bob
Community Expert
Community Expert
May 31, 2022 5:47 PM UTC

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.

Translate