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

Stop and Play Sound from one button

Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

This is my code where it can only stop. I want to make it play the song back can anyone help ?

 

silence.addEventListener(MouseEvent.CLICK,onStop);
function onStop(e:MouseEvent):void{
SoundMixer.stopAll();
silence.visible=false;
}

Views

901

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

what's the code used to start the sound? or, if it's timeline sound, it needs to be in a movieclip (generally) with nothing else.

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

mpi.suara("bgm", "loop", 10);
mpi.aturSuara("onOff");

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

can you help me step by step since im using scene by scene not frame by frame ?

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

mpi.suara("bgm", "loop", 10);

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

what's mpi.suara()?

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

its a code i copy in the youtube tutorial, basically its like a database. I can just remove it and follow your guide.

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

I just want to mute and unmute the background song not the button sound

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

where's the background sound ? in your  fl library or is it loaded from a file?

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

the background song in in the library with the linkage name bgm

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

create a new movieclip

place a stop() in frame 1

attach the sound to the 2nd frame

set its sync property to stream 

extend the timeline to allow the sound to play completely.

 

put the sound on the same timeline as your play sound /stop sound button and assign it an instance name, eg sound_mc

 

 

if your button's instance name is sound_toggle, you can then use

 

 var toggle:Boolean;

sound_toggle.addEventListener(MouseEvent.CLICK, sound_toggleF)

 

function sound_toggleF(e:MouseEvent):void{
if(!toggle){
sound_mc.play(); // continue sound

// sound_mc.gotoAndPlay(2);  play sound from start 

} else {
sound_mc.stop();
}
toggle=!toggle;

}

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

do I need to use button or can just use movie clip for the button ? there is an arrow saying SWF contains multiple copies of a sound item in which the song did not play 

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

you can use a movieclip.  i never use buttons.

 

movieclips can do everything buttons can do plus much more.

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

45thbang_0-1671660023122.png

did as what you say, the output file said

 

SWF contains multiple copies of a sound item

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

the error panel is too small to show its contents. 

 

and there's nothing i suggesed that would trigger what you report is in the output panel

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

the error panel is too small means ? what do I need to do ? 

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

you should drag that so it's large enough to show if there's an error, but the output panel (which i didn't see) already indicates a problem.

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

45thbang_1-1671661839313.png

 

this is the one ?

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

that's readable, and errors panel is there. click its tab to make sure nothing is there.  

 

then click file>publish setting >tick permit debugging and retest to see if there's more info in your output panel.  

 

let me know what's in the output and error panel after ticking that publish setting.

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

45thbang_0-1671662947145.png

this ? how to solve this problem ? did I need to expand the timeline on the main menu for sound too?

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

btw can we zoom, teams or something to solve this problem? I need to do the testing in 2 hour if youre not busy

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

upload your fla somewhere and post a link here.

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
Explorer ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

hi did you can access it ?

Votes

Translate

Translate

Report

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 ,
Dec 21, 2022 Dec 21, 2022

Copy link to clipboard

Copied

what a mess.  that makes it so difficult. 

 

i cleaned up your library enough to see all the assets in the library panel.  but part of you slopiness caused the problem: you have so much white space at your sounds start, you can't tell the sound is playing until 3+ seconds after it starts.

 

anyway, i did fix for it, but it would be better to open in audition and cut the white space.

 

and learn to append increasing version numbers on your fla names.  here's your corrected fla:

 

https://www.kglad.com/Files/forums/mm_v001.fla

Votes

Translate

Translate

Report

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