hi there i am using this code to stream sound
import flash.media.SoundMixer;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
removeChild(lpc);
stop();
var soundOne:URLRequest = new URLRequest("sound.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(8000);
var songOne:Sound = new Sound();
var volumeControl:SoundTransform=new SoundTransform();
var soundControl:SoundChannel = new SoundChannel();
songOne.load(soundOne, context);
songOne.addEventListener(Event.COMPLETE, onComplete2);
function onComplete2(event:Event):void
{
vividS.addEventListener(MouseEvent.CLICK, playOne);
vividP.addEventListener(MouseEvent.CLICK, stopOne);
trace('song one loaded');
}
function playOne(event:MouseEvent):void
{
SoundMixer.stopAll();
soundControl.stop();
vividS.visible = false;
vividP.visible = true;
}
function stopOne(event:MouseEvent): void
{
SoundMixer.stopAll();
soundControl = songOne.play();
soundControl.soundTransform=volumeControl;
vividP.visible = false;
vividS.visible = true;
}
songOne.play();
vividP.visible = false ;
i want to know how to replay sound after it finished but without streaming it again