le cambie un poco la estructura, pero no lo puedo probar ya que no tengo los flv ni el xml.. trata tu y me avisas:
Código:
stop();
var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
obj_xml.onLoad = function(exito) {
if (exito) {
getVideo( this.firstChild );
var conexion:NetConnection = new NetConnection();
conexion.connect( null );
var stream:NetStream = new NetStream(conexion);
video_publicidad.attachVideo(stream);
// reproducimos el stream
stream.play(urlPubli);
// Comprobamos si ha terminado de reproducirse el video
conexion.onStatus = function(info) {
if(info.code == "NetStream.Play.Stop") {
gotoAndPlay( 3 );
}
}
function getVideo( xmlNode ) {
if( xmlNode.nodeName.toUpperCase() == "VIDEOS" ) {
// Cogemos el primer hijo del documento xml
video = xmlNode.firstChild;
video = video.nextSibling;
if( video.nodeName.toUpperCase() == "PUBLICIDAD" ) {
urlPubli = video.firstChild.nodeValue;
}
// Siguiente nodo
video = video.nextSibling;
if( video.nodeName.toUpperCase() == "REAL" ) {
urlReal = video.firstChild.nodeValue;
}
}
}
}else{
trace("error")
}
}
objXML.load( "videos.xml" );