Solved

Background music Mute/Play problem (urgent)

Posted on 2004-03-22
9
1,022 Views
Last Modified: 2012-08-14
I have a music loop clip which is playing continuously in the backgound and voiceover to text which displayed on screen. I am using two different buttons for background music and voiceover. Problem is i want background music to be stopped when click mute button. I tried using "mySound.setVolume(0)" method, it stops both background music and voiceover to text. Please help me. Thank you.
0
Comment
Question by:anjip
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 4

Expert Comment

by:RedLava
ID: 10655504
Hi mksuhale,

How is the background music started. If it is placed in the timeline at design time the best idea is to take it out of here and load it at runtime as a sound object. This sound object can then have it's setVolume value altered.

The question is, is the background sound loaded at runtime or embeded at design time?

RedLava
0
 
LVL 4

Expert Comment

by:RedLava
ID: 10655555
0
 
LVL 9

Expert Comment

by:rexmor
ID: 10656017
anjip,

maybe something like this...

bgrnd_snd = new Sound();
voice_snd = new Sound();

bgrnd_snd.loadSound("bgrnd_snd.mp3,1);
bgrnd_snd.start(1,0);

voice_snd.loadSound("voice_snd.mp3,1);
voice_snd.start(1,0);


bgrnd_snd_btn.onRelease= function(){
   bgrnd_snd.stop();
 //  bgrnd_snd.setVolume(0);
}



0
 
LVL 1

Author Comment

by:anjip
ID: 10656963
Hi RedLava,

Background music loaded at run time.

Background music is in "bgsnd.swf" and vocieover in "voice_snd.swf".
when "voice_snd.swf" is playing "bgsnd.swf" loaded in to "voice_snd.swf" at different _level

anji
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:anjip
ID: 10657011
hi rexmor,

Button is toggle button. When i stop and want to start it again, it does not start.

anji
0
 
LVL 1

Expert Comment

by:andylaw78
ID: 10657150
hey anjip,

how about putting each sound in different movie clips, then when starting/stopping sounds, calling them from the movie clips?

somthing like
_root.sound1.mySound.setVolume(0);
_root.sound2.mySound.setVolume(0);

Separating them like this should stop them from both stopping

good luck!
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 10657874
you should be using the Sound Object, which I believe you are trying to do...

I think you may be using the same object for both sounds, so when you set mySound to a volume of 0, it sets all sounds objects attached to the mySound object to 0...

I believe rexmor has the right idea by using 2 seperate sound objects...

please post your .FLA to a web site and provide the url....  we can take a crack at the actual file...


rp  
0
 
LVL 9

Accepted Solution

by:
rexmor earned 500 total points
ID: 10663422
hello everyone,

anjip, why you still need to put your sound into .swf? instead of external mp3 file...

for a toggle

soundStatus = true // default sound is playing

if(!soundStatus ){
mySound.start()// you need to get the duration where it stop.
}else{
mySound.stop();
}

Please post ur .fla as rp suggested.



rexmor

0
 
LVL 8

Expert Comment

by:Cerf
ID: 11245608
Anji, are you still there?

Do you still need our help?

Did someone resolved your problem?

Regards,

Cërf.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now