Código :
video_tmp="OnTV/tu.flv" var conexion:NetConnection = new NetConnection(); conexion.connect(null); var stream:NetStream = new NetStream(conexion); mi_video.attachVideo(stream); stream.play(video_tmp); //aseguramos 10 seg de reproduccion stream.setBufferTime(10); // barra._xscale = 0; onEnterFrame = function () { bu_cargado.text = stream.bufferLength; bu_trans.text = stream.time; bu_total.text = Math.round(stream.bytesTotal/1024)/1000+" mb"; }; //botones_----------------------------------- seg.restrict = 1-9; btn1.onPress = function() { stream.play(video_tmp); }; btn1_1.onPress = function() { stream.close(); }; btn2.onPress = function() { stream.pause(); //obvio, para hacer pausa, ojo q es lo mismo para avanzar }; btn3.onPress = function() { stream.seek(0); // va al inicio (cero segundos) }; btn4.onPress = function() { stream.seek(seg.text); // va al segundo q nosotros escribamos }; //status stream.onStatus = function(infoObject:Object) { if (infoObject.code == "NetStream.Play.Stop") { trace("acabo"); } if (infoObject.code == "NetStream.Play.StreamNotFound") { trace("encontro error"); } }; //---------------------------------------------------------------------------- mi_combo.addItem("video_1", 0); mi_combo.addItem("video_2", 1); mi_combo.addItem("video_3", 2); //Listeners para cuando seleccionamos alguna opcion alSeleccionar = new Object(); alSeleccionar.change = function(evento) { trace("Has seleccionado "+evento.target.value); switch (evento.target.value) { case 0 : video_tmp="tu.flv" stream.play(video_tmp); break; case 1 : video_tmp="yo.flv" stream.play(video_tmp); break; case 2 : video_tmp="el.flv" stream.play(video_tmp); break; } }; mi_combo.addEventListener("change",alSeleccionar);
El video se visualiza a la perfeccion, pero no entiendo porqué no me funciona el componente combobox. Es decir, este funciona si visualizo unicamente el archivo swf que contiene el codigo, pero si abro la principal y esta carga el swf no se ve correctamente. Si es por el _root, alguien sabe donde tengo que colocarlo?
Perdonad si os he hecho un lio.
Muchas gracias por la paciencia y por la ayuda. Saludos.