PDA

View Full Version : Playing a embedded sound in an external .swf



bsyapril88
July 30th, 2008, 03:55 PM
Is there a way to play a sound that has been embedded in an externally loaded .swf from the main .swf (the .swf that loaded it)?

Playing the embeded sound from within the same .swf is easy but how is it possible from the main .swf?

var drum:DrumSound = new DrumSound();
var channel:SoundChannel = drum.play();

aBnest
July 30th, 2008, 04:09 PM
just put the code you need to play the sound in a public function.
You will be able to call that function when the swf is loaded.

something like this:

in your "external swf":

public function playSound():void
{
var drum:DrumSound = new DrumSound();
var channel:SoundChannel = drum.play();
}


and then in your "main swf" :

loadedSWf.playSound();