Skip to Content

Flash Sound Object Part 7 - Master Volume and On/Off button

Author: Bill Trikojus

This tutorial will show you how to control the volume of all the sounds in your Flash application from a single volume slider.  An alternative to the technique shown in the tutorial is to create a 'global' sound object and adjust the volume of that which will affect all sounds in your application. While this requires less code, you do lose some control.  For example, you may have some sounds in your application (button rollovers etc) that you do not want to be controlled by the master volume control.  In any case, to create a global sound object you simply create a new sound object without providing a target timeline. eg

//nothing between the ()
myMasterSoundObject=new Sound();

Changing the volume of this sound with

myMasterSoundObject.setVolume(50);

would affect the volume of all sounds in your application.  Whether you choose this technique or the one outlined in the tutorial will depend on the requirements of your Flash application.

 

1

Part one

bulletLaunch video file

Download the finished source files here

bulletBack


Share

Like this? Click a link below to share it...


Subscribe and Download

Subscribe to the Swinburne Faculty of Design Podcasts

Comments

2010-11-23: Jane said:
This is exactly what I needed. Thanks.

Post a comment

Garbage posts and SPAM will be deleted.

* Name:
* Email: (will not be made public)
* Comment:
* Reply Notification: