Código ActionScript :
var canal:SoundChannel;
var som:Sound = new Sound();
btnPlay.visible=false;
var carregaTexto:URLLoader = new URLLoader();
carregaTexto.dataFormat = URLLoaderDataFormat.VARIABLES;
carregaTexto.load( new URLRequest( "externo.txt" ) );
carregaTexto.addEventListener( Event.COMPLETE, carregaTexto_onComplete);
function carregaTexto_onComplete ( evento:Event ):void
{
som = new Sound();
som.load( new URLRequest( (evento.target.data.variavel).toString() ));
canal = som.play();
}
btnStop.addEventListener(MouseEvent.CLICK, btnStop_CLICK );
btnPlay.addEventListener( MouseEvent.CLICK, btnPlay_CLICK );
function btnStop_CLICK ( e:MouseEvent ):void
{
canal.stop();
btnStop.visible=false;
btnPlay.visible=true;
}
function btnPlay_CLICK ( e:MouseEvent ):void
{
btnPlay.visible=false;
canal = som.play();
btnStop.visible=true;
}
Alguien tiene una idea de que pude estar aconteciendo? Desde ya muchas gracias. Claudio
