Ver Mensaje Individual
  #10 (permalink)  
Antiguo 02/04/2007, 04:58
edude
 
Fecha de Ingreso: marzo-2007
Mensajes: 89
Antigüedad: 17 años, 1 mes
Puntos: 0
Re: urgente: cuando acaba un flv????

Ok, aquí esta el código completo:

// Posicion del movie clip
x = 38;
y = 14;

// Activamos el objeto XML
objXML = new XML();

// Igonramos espacios en blanco
objXML.ignoreWhite = true;

// Cargamos el documento XML
objXML.onLoad = myLoad;
objXML.load( "videos.xml" );

// Antes de empezar, nos aseguramos que el documento XML se ha cargado
// Extract information from the XML file
function myLoad( ok ) {
if( ok == true ) {
getVideo( this.firstChild );
}
}

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;
}
}

var conexion:NetConnection = new NetConnection();
conexion.connect( null );
var stream:NetStream = new NetStream(conexion);
videopubli.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 );
}
}
}