Hola me surje la siguiente DUDA:
Cargar dinamicamente N videos y mostrarlos SIMULTANEAMENTE EN PANTALLA.
Para cargar 1 video utilizo el archiconocido código:
Código:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(3);
mivideo.attachVideo(stream_ns);
lugar = "video"+i+".flv";
stream_ns.seek(0);
stream_ns.play(lugar);
stream_ns.seek(0);
¿PERO Y PARA CARGAR N VIDEOS DE MANERA DINAMICA? (Perdón por las mayúsculas)
por ejemplo yo lo estaba intentando asi:
Código:
for (var i=0; i<numerovideos; i++) {
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(3);
elvideo="mivideo"+i;
eval(elvideo).attachVideo(stream_ns);
lugar = "video"+i+".flv";
stream_ns.seek(0);
stream_ns.play(lugar);
stream_ns.seek(0);
}
Pero cuando sustituyoel nombre de los objetos por eval, ME FALLA, por ejemplo:
Código:
for...{
...
laconexion="connection_nc"+i
var eval(laconexion):NetConnection = new NetConnection();
...
}
Tambien me falla si creo el objeto en una funcion, ya que si hago el eval donde recibo me pasa lo mismo.
¿Que hago mal?
Muchisimas gracias si podeis echarme una manita.