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

SYNCRONIZED MUTE/UNMUTE SOUND BUTTON WHEN I CHANGE TO OTHER SCENE

New Here ,
Jun 03, 2024 Jun 03, 2024

how can i set mute/unmute button synchronizedly when I want to changed to next scene. example I already play the sound at scene 1 but when I go to the scene 3, I was muted the button, and then when I go to scene 4, supposedly system will muted the sound because previous sceneI have muted the sound. But when I changed to scene 4 the sound play from the beginning of music. and this problems continuously to others frame also. 

 

I very need a help, thank you

 

Nurul30711656tmef_0-1717444494233.pngNurul30711656tmef_1-1717444533763.pngNurul30711656tmef_2-1717444552509.png

 

311
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 ,
Jun 03, 2024 Jun 03, 2024

you'll need to use code.

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
New Here ,
Jun 03, 2024 Jun 03, 2024

i have used this code for sound to every scene

stop();
import flash.media.Sound;
import flash.media.SoundChannel;
 
SoundMixer.stopAll();
btn_sound.addEventListener("click",function(){
btn_sound.gotoAndPlay(2);
 
});
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 ,
Jun 03, 2024 Jun 03, 2024

declare a boolean mute variable and use it to determine when to play clicks.

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
New Here ,
Jun 03, 2024 Jun 03, 2024

which part must i change/add to my code

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 ,
Jun 03, 2024 Jun 03, 2024
LATEST

eg,

 

var mute:Boolean;

 

you probably havve a mute toggle in your app, where you would us

 

mute=!mute;

 

then wherever you have code (on the main timeline) to play a sound use

 

if(!mute){
// play your sound
}

 

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