This content has been marked as final. Show 7 replies
you sound (sAmbience.play() ) returns a soundchannel instance which has a soundTransfrom property. that soundTransform property has a volume property that will set the volume for your sound (sAmbience).
you can use any loop (ENTER_FRAME or timer) to fade that volume property.
Thank you for your response.
I trigger the sound to play like this:
and that of course starts playing the mp3 no problem, so your saying decrement/increment the "sAmbineceVol" ?
Could you give me an example of the loop? I realize your not here to "write my code for me", but this seems to have me stumped.
read the help files. i listed all the steps involved. here they are in code:
Ok, here is my latest code:
var soundFadeInTimer:Timer = new Timer(100,30);
var fadeInIncr = 0.1;
fadeInIncr += 1/30;
var snd:Sound = new Sound(new URLRequest("myLoop.mp3"));
var trans:SoundTransform = new SoundTransform(fadeInIncr, 0); // 1=vol, 0=pan
var channel:SoundChannel = snd.play(0, 1, trans);
When viewing the trace output, the "fadeInIncr" varible is being increased like it is supposed to.
However, the volume is not increasing.
I finally got a working sound fade in object, but I think I like yours better. Thank you for the help!