PDA

View Full Version : Low Volume on as3


Nimaro
11-13-2009, 08:58 AM
Hy everyone,

I use this function to start the music in my project

function tocar() {
soundFactory.addEventListener(Event.COMPLETE, completeHandler);
soundFactory.addEventListener(IOErrorEvent.IO_ERRO R, ioErrorHandler);
soundFactory.addEventListener(ProgressEvent.PROGRE SS, progressHandler);
soundFactory.load(request);
song = soundFactory.play(); }
--------------------------------------------------------------------------
Now i wana low volume of the music. I thought it was something like song.volume = 90; but i was wrong :p

Can u guys help me on this???

henke37
11-13-2009, 09:06 AM
SoundChannel objects have an associated SoundTransform object.

Nimaro
11-13-2009, 09:29 AM
i think im seing what u mean...

i got this vars.....

public var soundFactory:Sound = new Sound();
public var song:SoundChannel = new SoundChannel();

-------------------------------------------------------------------------
i tried in my function things like this ---

//song.soundTransform(0.5,1.0);
var song:SoundTransform = new soundTransform(0.5,1.0);

im not geting the right sintax for what i need... can u help with this????

box86rowh
11-13-2009, 12:02 PM
all you have to do is make a soundTransform object:
SoundTransform st = new SoundTransform();
set the volume
st.volume = .3;
and apply it
song.soundTransform = st;