Jorge, consulta, se tendria que modificar algo de aca??
Código ActionScript :
// ------------------------ miVideo -------------------------------
var conexion:NetConnection = new NetConnection();
conexion.connect(null);
var stream:NetStream = new NetStream(conexion);
miMovieClip.miVideo.attachVideo(stream);
stream.play("video1.flv");
// ------------------------ miVideo2 -------------------------------
var conexion2:NetConnection = new NetConnection();
conexion2.connect(null);
var stream2:NetStream = new NetStream(conexion2);
miMovieClip2.miVideo2.attachVideo(stream2);
stream2.play("video2.flv");
miMovieClip2.miVideo2.pause();
Y en la funcion no faltaria el stream2??
Código ActionScript :
function fadeVideo(fadeOut:MovieClip, fadeIn:MovieClip, stream:NetStream, stream2:NetStream):Void {
Codigo completo:
Código ActionScript :
// ------------------------ miVideo -------------------------------
var conexion:NetConnection = new NetConnection();
conexion.connect(null);
var stream:NetStream = new NetStream(conexion);
miMovieClip.miVideo.attachVideo(stream);
stream.play("video1.flv");
// ------------------------ miVideo2 -------------------------------
var conexion2:NetConnection = new NetConnection();
conexion2.connect(null);
var stream2:NetStream = new NetStream(conexion2);
miMovieClip2.miVideo2.attachVideo(stream2);
stream2.play("video2.flv");
miMovieClip2.miVideo2.pause();
// ------------------------ BOTON -------------------------------
btnN1.onPress = function(){
if(miMovieClip.visible) {
fadeVideo(miMovieClip, miMovieClip2, stream);
stream2.play("video2.flv");
} else {
fadeVideo(miMovieClip2, miMovieClip, stream2);
stream.play("video.flv")
}
}
// ------------------------ FUNCION -------------------------------
var speed = 5;
function fadeVideo(fadeOut:MovieClip, fadeIn:MovieClip, stream:NetStream):Void {
this.onEnterFrame = function() {
fadeOut._alpha -= speed;
fadeIn._alpha += speed;
if (fadeIn._alpha >= 100) {
fadeOut._visible = false;
stream.stop();
delete this.onEnterFrame;
}
};
}
El resultado es la reproduccion simultanea de los dos video, luego a tocar el btnN1 se ve solamente video1, pero sin el fade out ni el fade in.
Hay algo que esto haciendo mal??
De nuevo gracias Jorge!