Comunidad de diseño web y desarrollo en internet online

intergracion sonido: dificultades al leer variable

Citar            
MensajeEscrito el 16 Abr 2006 08:52 pm
Buenas tardes a todos. Tengo un problema para reproducir el sonido en flash.
//primero cargo 2 canciones dentro de flash
_root.createEmptyMovieClip("soundLib", 1);

soundLib.createEmptyMovieClip("holder_1", 1);
sound_1=new Sound(soundLib.sound_1);

soundLib.createEmptyMovieClip("holder_2", 2);
sound_2=new Sound(soundLib.sound_2);

sound_1.loadSound("/orquestra/song5.mp3", false);
function progressLoad_1(){
var porsentaje=(sound_1.getBytesLoaded()/sound_1.getBytesTotal())*100;
cargado_1.text=Math.round(porsentaje)+" %";
}
checkprogress=setInterval(progressLoad_1, 1000);

sound_2.loadSound("/orquestra/song2.mp3", false);
function progressLoad_2(){
var porsentaje=(sound_2.getBytesLoaded()/sound_2.getBytesTotal())*100;
cargado_2.text=Math.round(porsentaje)+" %";
}
checkprogress=setInterval(progressLoad_2, 1000);

ME CARGA TODO SIN ERROR, LUEGO
HAY 2 BOTONES PARA SELECCIONAR UNA DE LAS 2 CANCIONES.[/b] (hay mas pero quiero entende donde esta el error)

seleccionar_cancion1.onRelease=function(){
//si aprieta este boton seleccionatara cancion 1 que corresponde a sound_1
tema.text="sound_1";

}
seleccionar_cancion2.onRelease=function(){
//si aprieta este boton seleccionatara cancion 2 que corresponde a sound_2
tema.text="sound_2";

AHORA TENGO 2 BOTONES SAUND START Y SOUND STOP
sound_start.onRelease=function()
{
//recojo opcion de cancion que elejio el usuario
var tema1=tema.text;
trace(tema1);
tema1.start(0,1);

}
sound_stop.onRelease=function()
{
var tema1=tema.text;
trace(tema1);
tema1.stop();
}
funcion trace() escribe opcion elejida de forma correcta pero el sonido no se reproduce. SI pongo en lugar de tema1.start(0,1); sound_1.start(0,1); o sound_2.start(0,1); si reproduce.
No entiendo porque no lee variable tema1.
Gracias por auyda y por vuesta estupenda web.[/b]

Por skywalker

28 de clabLevel



Genero:Femenino  

opera
Citar            
MensajeEscrito el 17 Abr 2006 04:37 pm
Creo que porque esa variable no es una ruta.
escribe:
var tema1=eval(tema.text);

Por Teseo

SWAT Team

1780 de clabLevel

14 tutoriales

Genero:Masculino   SWAT

msie
Citar            
MensajeEscrito el 17 Abr 2006 08:36 pm
Gracias! si con var tema1=eval(tema.text); funciona , aunque no entiendo bien que hace exactamente esa funcion.
Que haria yo sin vosotros.
Un saludo muy grande.

Por skywalker

28 de clabLevel



Genero:Femenino  

opera

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.