Programación flash

Solo disponible en BuenasTareas
  • Páginas : 2 (257 palabras )
  • Descarga(s) : 0
  • Publicado : 3 de mayo de 2011
Leer documento completo
Vista previa del texto
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.MouseEvent;
import flash.net.URLRequest;

//declaramos variables y audio
var miSonido: Sound=new Sound();
varmiSonido2: Sound=new Sound();
var miSonido3: Sound=new Sound();
//esta varuable sirve para cargar un archivo .mp3
var miCanal: SoundChannel=new SoundChannel();
//esta variable sirve para darle playal audio

//Listeners
play_btn.addEventListener(MouseEvent.CLICK, playRola);
stop_btn.addEventListener(MouseEvent.CLICK, stopRola);
mail_btn.addEventListener(MouseEvent.CLICK, goMail);miSonido.load(new URLRequest("littlesecrets.mp3"));

function playRola (e:MouseEvent):void {
miCanal=miSonido.play();
cargador.source="littlesecrets.jpg";
artista_txt.text="Passion Pit"rola_txt.text="Little Secrets"
play_btn.removeEventListener(MouseEvent.CLICK, playRola);
}
function stopRola (e:MouseEvent):void{
SoundMixer.stopAll();
cargador.source=null;
artista_txt.text=""rola_txt.text=""
play_btn.addEventListener(MouseEvent.CLICK, playRola);
}
function goMail (e:MouseEvent):void {
navigateToURL(new URLRequest("http://www.gmail.com/"));
}

//Listenersplay2_btn.addEventListener(MouseEvent.CLICK, playRola2);
stop2_btn.addEventListener(MouseEvent.CLICK, stopRola2);

miSonido2.load(new URLRequest("funeral.mp3"));

function playRola2 (e:MouseEvent):void {miCanal=miSonido2.play();
cargador2.source="funeral.jpg";
artista_txt2.text="Band of Horses"
rola_txt2.text="The Funeral"
play2_btn.removeEventListener(MouseEvent.CLICK, playRola2);
}
function stopRola2(e:MouseEvent):void{
SoundMixer.stopAll();
cargador2.source=null;
artista_txt2.text=""
rola_txt2.text=""
play2_btn.addEventListener(MouseEvent.CLICK, playRola2);
}

//Listenersplay3_btn.addEventListener(MouseEvent.CLICK, playRola3);
stop3_btn.addEventListener(MouseEvent.CLICK, stopRola3);

miSonido3.load(new URLRequest("rebellion.mp3"));

function playRola3 (e:MouseEvent):void {...
tracking img