PDA

View Full Version : mute sound after loading swf



bd1234
January 3rd, 2008, 05:13 AM
how can I mute sound after loading swf using Loader object?

I tried to use the following code after Loader dispatch complete event:

(loader.content as Sprite).soundTransform = new SoundTransform(0);

but it still play the sound in the first frame of my swf file before the sound is mute.

the code works if I move the start of my sound wave to second frame in my swf, but I need to play at the first frame.

Please help, thanx.

trifox
January 3rd, 2008, 08:51 AM
try to place it inside the init event handler ...

bd1234
January 3rd, 2008, 10:47 AM
try to place it inside the init event handler ...

didnt work as well, the loader content still play the swf's first frame.

bd1234
January 3rd, 2008, 09:29 PM
If I use loader.load(new URLRequest("test.swf")),

using init listener can mute the sound.

But I am using loadBytes method to get it's swf content, I think it might already play the sound in the swf as it is loading the bytearray?

Is there any way to mute the load content before it is being loaded?

Thanx.