Solved

Background music Mute/Play problem (urgent)

Posted on 2004-03-22
9
1,021 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

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…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
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.

747 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

14 Experts available now in Live!

Get 1:1 Help Now