Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

audio wont stop when i click button please help

New Here ,
May 31, 2022 May 31, 2022

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

 

 

TOPICS
ActionScript
101
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2022 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2022 May 31, 2022
LATEST

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

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines