Hi.

I use Sound class to load a mp3 file.

Code:

var _url:URLRequest = new URLRequest("...");

var _mp3:Sound = new Sound();

_mp3.load(_url);

_mp3.addEventListener(Event.COMPLETE, onLoad);

var _soundChannel:SoundChannel;

...

private function onLoad(event:Event):void
{
         _soundChannel = _mp3.play();
         _soundChannel.soundTransform.volume = 0;
}

I want to set the volume property to zero while playing the mp3 file.
However, it seems that the code

   _soundChannel.soundTransform.volume = 0;

doesn't work.

Then I use the following code instead:

var transform:SoundTransform = _soundChannel.soundTransform;

transform.volume = 0;

_soundChannel.soundTransform = transform;     //###

Then it work perfectly, but if I delete the code marked with //###, it
still doesn't work.

What's the reason?
In my opinion, the transform object and the _soundChannel.soundTransform
object are one and the same, isn't it?

Reply via email to