Solved

Background music Mute/Play problem (urgent)

Posted on 2004-03-22
9
1,024 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

786 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