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
Solved

making a button to change the global volume

Posted on 2007-11-19
4
572 Views
Last Modified: 2008-02-07
Im making a cd rom with voice over prompts for stage elements. Id like the user to able to turn off the prompts if they so choose. Unfortunatly stopallsounds works for continuous audio so I think I need a solution that checks the current global volume and turns it to the oposite. ie, if the volume is on (100) the button then turns it to off (0) and vice versa. In this way the user can turn sound on and off.
Any help will be gratefully received.
0
Comment
Question by:sousflai
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
DavidTMoore earned 500 total points
ID: 20316344
(note this is AS2, please let me know if you need AS3 code)

Put this in the first frame of the main timeline, this should create a global sound variable.

var globalSound:Sound = new Sound();
globalSound.setVolume(100);


then on your button click event handler use the following code.

if(_root.globalSound.getVolume() == 100)
{
      _root.globalSound.setVolume(0);      
}
else
{
      _root.globalSound.setVolume(100);
}


cheers
~David
0
 

Author Comment

by:sousflai
ID: 20324172
your a genius!
0
 
LVL 4

Expert Comment

by:DavidTMoore
ID: 20324508
glad to help.

cheers
~David
0
 

Author Comment

by:sousflai
ID: 20324522
I dont suppose you know how to get a button create an empty movie clip then import a jpg file from the library inside the clip. Also importing a button that will automatically remove the movie clip when pressed?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Viewers will learn how to turn a Live Set into a compressed Live Pack file, and how to install Live Packs. Make: File > Collect All And Save: File > Manage Files: Click Manage Project: Click Create Pack: Select save location: Install: Doub…
The goal of the tutorial is to teach the user how to how to record live broadcast.

861 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