Hello :)

in my opensource framework (VEGAS) i use a SoundLibrary class to manage my
sounds...

http://svn.riaforge.org/vegas/AS2/trunk/src/andromeda/media/SoundLibrary.as

Exemple :

{{{

import andromeda.media.SoundLibrary ;

var lib:SoundLibrary = new SoundLibrary() ;

lib.addSound( "sound_1" ) ; // sound in the library with the link "sound_1"
lib.addSound( "sound_2" ) ; // sound in the library with the link "sound_2"
lib.addSounds( ["sound_3", "sound_4"] ) ; // add an Array of sounds in
the library

lib.loadSound( "my_sound.mp3", "sound5" ) ;
lib.loadSound( "sound6.mp3" ) ; // add the external sound and auto
create the 'sound6' id of the sound in the library


lib.setVolume( 50 ) ; // all sounds in the library changes the volume.

lib.getSound("sound2").setVolume( 40 ) ; // change the volume of the
'sound2' Sound reference in the library.

}}}

This class inherit the SoundModel class :
http://svn.riaforge.org/vegas/AS2/trunk/src/andromeda/media/SoundModel.as

You can use an MVC pattern with this library with a global event flow etc..

This class is really easy to use :) Use the addSound or the addSounds ou the
loadSound methods to register your local or external sounds..

You can find the VEGAS project page in Google Code :
http://code.google.com/p/vegas/
You can find the tutorial to install VEGAS :
http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN

You can find the documentation of my framework :
http://vegas.ekameleon.net/docs
You can find the SoundLibrary reference :
http://vegas.ekameleon.net/docs/andromeda/media/SoundLibrary.html
You can find the SoundModel reference :
http://vegas.ekameleon.net/docs/andromeda/media/SoundModel.html

You can see my AS2 opensource template AST'r .. in the sources of the
project you can see my personal usage of my Framework.. in this context i
use an external file of config to defines all sounds and i load an external
sound to shared the sounds of the the application....

http://code.google.com/p/astr/

EKA+ :)

2007/7/6, Rákos Attila <[EMAIL PROTECTED]>:


Sound objects associated with the same movie clip share their
properties (volume, etc.), so if you change the volume through one of
them, the change will be reflected by others, too. That is because in
fact sound properties belong to movie clips and not the Sound objects,
and Sound objects only reflect the sound settings of the associated movie
clip.

  Attila


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From:    [EMAIL PROTECTED] <[EMAIL PROTECTED]>
To:      flashcoders@chattyfig.figleaf.com <
flashcoders@chattyfig.figleaf.com>
Date:    Friday, July 6, 2007, 4:44:25 PM
Subject: [Flashcoders] Controllingt he volume of multiple sound objects at
the same time

--====----====----====----====----====----====----====----====----====----===--

Hey there. I am trying to control the volume of a number of sound objects
that have their own individual volume levels. I want to be able to mute them
or allow them to play at the volume that has been set for them. I was
thinking that I could do this by storing the values in arrays and then
looping through these each time the sound is muted/unmuted but I am sure
there must be an easier way.
Any suggestsions v gratefully received :)

Here is what I have so far:
var sound1:Sound = new Sound(this);
sound1.setVolume(60);
var sound2:Sound = new Sound(this);
sound2.setVolume(20);

sound1.loadSound('an.mp3', false);
sound2.loadSound('another.mp3', false);

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to