Comunidad de diseño web y desarrollo en internet online

LLamada a video de precarga desde otro MC que es un scroll

Citar            
MensajeEscrito el 12 Sep 2007 10:22 am
Hola tengo una escena que es un video con precarga y todo ok con 5 botones puedes elegir entre 5 videos etc,

pero como quiero poner mas videos tengo que poner un scroll con botones, pues bien al insertar dentro los botones dejan de funcionar y si los saco del MC del scrol vuelven ha funcionar.

lo que quiero hacer es algo parecido a esto.

http://www.naish.tv/

gracias de antemano, supongo que me dejo alguna instruccion de enlace entre los videos no?

Por GuSFiLMS

1 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 12 Sep 2007 02:57 pm
Postea el código de los botones

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox
Citar            
MensajeEscrito el 13 Sep 2007 09:08 am
Hola Herr C Von Frick, primero muchas gracias por responder, la escena esta basada un un tutorial antiguo de El dervaz,

este es el codigo.


Código :


// BASADO EN EL TUTORIAL EL DERVAZ

//toda esta parte ya la conocemos
var conexion:NetConnection = new NetConnection();
conexion.connect(null);
var stream_ns:NetStream = new NetStream(conexion);

//ponemos el primer video en el buffer
mi_video.attachVideo(stream_ns);
stream_ns.play("p1.flv");
//10 seg de margen
stream_ns.setBufferTime(10);



   
   // EMPIEZO LOS BOTONES
   
bplay.onPress = function (){
            stream_ns.pause ();            
            };
            

bpause.onPress = function (){
            stream_ns.pause();
            play.onPress = function (){
            stream_ns.pause ();            
            };
                 };
bstop.onPress = function() {
            stream_ns.seek();
            stream_ns.pause();         
              };
             
bmenosdiez.onPress = function() {
            stream_ns.seek(stream_ns.time-10);         
              };
             
bmasdiez.onPress = function() {
            stream_ns.seek(stream_ns.time+10);         
              };
             
             
             //EMPIEZO BOTONES DE VIDEO

progr.onPress = function() {
            stream_ns.play("cartelera.flv")
            sinopsis.text =" WINTER PROJECT COOMING SOON IN GFPTV";   
              };
             
progr1.onPress = function() {
            stream_ns.play("tricks.flv");
            sinopsis.text =" SCREW By Jose Luengo";
            };
            
progr2.onPress = function() {
            stream_ns.play("lessons.flv");   
            sinopsis.text =" Learn the basics with Jaime Herraiz";
            };
              
             
progr3.onPress = function() {
            stream_ns.play("rider.flv");      
            sinopsis.text =" Oliver, Rider from tenerife";
             };
             
progr4.onPress = function() {
            stream_ns.play("vclip.flv");         
            sinopsis.text =" Spanish Champinship - Tarifa";
            };
             
d1.onPress = function() {
            stream_ns.play("entreoru.flv");         
            sinopsis.text =" Spanish Champinship - Tarifa";
            };
             
d2.onPress = function() {
            stream_ns.play("entreoru.flv");         
            sinopsis.text =" Spanish Champinship - Tarifa";
             };
              
             
d3.onPress = function() {
            stream_ns.play("tsummer.flv");         
            sinopsis.text =" Spanish Champinship - Tarifa";
              };
// muestro el tiempo
onEnterFrame = function(){
            txt.text=Math.round(stream_ns.time)+ "s " ;
                           
            };
            
this.onEnterFrame = function() {
   //obtengo el porcentaje
   var valor1:Number = Math.round(stream_ns.bytesLoaded/stream_ns.bytesTotal*100);
   //inserto la informacion el la caja de texto del buffer
   campo.text = Math.round(stream_ns.bytesLoaded/1000)+" de "+Math.round(stream_ns.bytesTotal/1000)+" KB cargado("+valor1+"%)";
   
   };

               




partir de aqui lo unico que hago para hacer la prueba de crear un nuevo MC e insertar dentro los botones y ya no funcionan. puedes ver el ejemplo en http://gfptv.iespana.es/

gracias de antemano.

Por GuSFiLMS

1 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 13 Sep 2007 11:53 am
Bueno, parece que es simplemente un problema de rutas. Si metes los botones dentro del clip de película y no cambias nada del código, debe ser eso entonces. Prueba agregando un "with(_parent){ }". Te pongo un ejemplo:
[codigo]
progr.onPress = function() {
with(_parent){
stream_ns.play("cartelera.flv")
sinopsis.text =" WINTER PROJECT COOMING SOON IN GFPTV";
}
};
[/codigo]

De todas maneras, te recomiendo que busques una forma más dinámica de crear los botones (puede ser haciendo un ayyar de botones o algo así) porque si creas cada uno en tiempo de diseño multiplicas el trabajo enormemente, además de que volverás pesadísima la película.
Nota: El ejemplo que te doy debería funcionar cuando lo metas en el movieclip.

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox
Citar            
MensajeEscrito el 13 Sep 2007 05:15 pm
Hola Von Frick, muchas gracias por la ayuda, me ha surgido un problema y es que despues de utilizar el with(_parent) se quedan los dos clips en reproduccion creo, digo creo por que solo veo las imagenes de uno pero suenan los dos, para solucionarlo he hecho esto haber lo que opinas, justo despues de poter buton stream_ns Close();

Código :

cartelera.onPress = function() {
   stream_ns.close();
    with(_parent){   
            stream_ns.play("cartelera.flv")
            sinopsis.text =" WINTER PROJECT COOMING SOON IN GFPTV";
            }
};


No se si será la mejor solucion,

gracias y un saludo

Por GuSFiLMS

1 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 13 Sep 2007 05:32 pm
Sí, en teoría debe funcionar, pero debes meterlo dentro del "with" para que apunte al stream_ns (que está fuera del clip de película)

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox

 

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