Solved

Background music Mute/Play problem (urgent)

Posted on 2004-03-22
9
1,027 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

738 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