Llevo un buen rato buscando una solución para crear un reproductor FLV con estos componentes. Ya he conseguido que se llene el componente List con el XML, pero no puedo hacer que se reproduzca.
Aquí esta el AS
Código :
import mx.controls.List;
import mx.video.*;
//Cargamos el XML
var listaXML:XML = new XML();
listaXML.ignoreWhite = true;
listaXML.onLoad = function(exito) {
if (exito) {
video = this.firstChild;
num_total = this.firstChild.childNodes.length;
crearLista();
} else
trace("No se pudo cargar la lista de videos");
};
listaXML.load("php/lista.xml");
lista.addEventListener("change", alCambiar);
function crearLista() {
//Posicionamos la lista de los videos
lista.setSize(180, 80);
//Llenamos la lista con las canciones
misDatos = new Array();
lista.dataProvider = misDatos;
for (var i = 0; i<num_total; i++) {
misDatos.addItem({label:video.childNodes[i].firstChild, data:video.childNodes[i].firstChild});
}
}
//Cuando cambiamos el video seleccionado en la lista... cargamos el nuevo video, y ejecutamos
function alCambiar(evento) {
if (evento.type == "change") {
flvPlayBack.autoRewind = false;
flvPlayBack.bufferTime = 5;
flvPlayBack.contentPath("flv/"+lista.selectedItem.data);
flvPlayBack.play();
}
}
