Sound objects and setVolume question

Hi,
I am trying to make a beat machine for a school project. It consists of 5 movie clip animations, controlled by buttons (on/off…)
I have 5 tracks of music loops, which i want to sync up, and then have each of the movie clip buttons control the volume of each respective track. (so that pressing the button will result in 1 of the 5 track’s volume to be 100, or 0) That way, the tracks will never come un-synced, but will give the sense of turning the individual tracks on or off. I know that I must define the sound objects like so:

s1 = new Sound();
s1.attachSound(“drum1”);
s1.start();

for each sound.

Where should this code go? and how do I make each button setVolume for each particular audio track?

I’ve been reading lots of stuff, but I am still really confused. Does anyone have any suggestions that might help me out?
Thanks very much!:slight_smile:

well, as for volume, just use:

s1.setVolume(value between 0 and 100);

Ok, thanks for the reply. I’m still having many troubles separating the tracks in terms of volume control. But at least I have buttons activating sound tracks now at least… the problem is all the buttons are controlling the volume for all of the tracks…Here is what I have so far:

sound objects s1 thru s5:

s1 = new Sound();
s1.attachSound(“drum1”);
s1.start(0,99999);

then at the end:

s1.setVolume(o);

on the button which is supposed to control s1: (each button is in a movie clip, so _root…)

on (press) {
_root.s1.setVolume(10o)(“drum1”);

and another button that sets volume back to 0.

So…I thought that by specifying the actual sound export instance “drum1” it would not act globally…I am so very wrong, hehe.
Any idea why? or better yet, how to isolate the sound clips in terms of volume control?
I could post my fla, but I must warn that the sound clips are wickid huge.

Thanks a lot!

Well, I’ve managed to isolate the tracks, but I am no longer using setVolume, i just have it set to play true or false. While this is good for sounds that aren’t synced up rhythmically, it kinda sux for syncing up tracks, like I originally wanted to. If anyone has any suggestions, I would love to hear it!
Thanks lots!