Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Actionscript to change volume

Status
Not open for further replies.

draigGoch

Programmer
Feb 10, 2005
166
GB
I am currently working on a game in flash, and i want to change the volume of the background music using actionscript, without changing the volume of the effects. This is what i have:

musicSound = new Sound(this.myClip);
musicSound.attachSound("song");
musicSound.start(0,999999);

musicSound.setVolume(10);

effectsSound = new Sound(this.myClip2);
effectsSound.attachSound("effect");
effectsSound.start(0,1);

But the musicSound.setVolume seems to set the global volume to 10, rather than that sound object. I don't think that i quite get this.............

I did read about the soundTransform object, but it threw errors! Any help would be appreciated!



A computer always does what you tell it to, but rarely does what you want it to.....
 
Oops - bloody typo in the code.........

A computer always does what you tell it to, but rarely does what you want it to.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top