Joost
10-11-2007, 03:27 PM
I'm working on a database with videofiles i want to play. But to make a nice overlap i want to use a nice crossfade.
This is what i have till now.
var nextup = "motor.flv";
_root.my_video._alpha = 0;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play(nextup);
//
stream_ns.onMetaData = function(obj) {
duration = obj.duration;
};
var time_interval:Number = setInterval(checkTime, 1, stream_ns);
function checkTime(my_ns:NetStream) {
if (_root.my_video._alpha<100) {
_root.my_video._alpha += 1;
}
if (my_ns.time>duration-2 and _root.my_video._alpha>0) {
_root.my_video._alpha -= 1;
}
}
This flv file fade's in and out, but i have know idea what to do next.
I hope someone can help me with this problem.
thnx
This is what i have till now.
var nextup = "motor.flv";
_root.my_video._alpha = 0;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play(nextup);
//
stream_ns.onMetaData = function(obj) {
duration = obj.duration;
};
var time_interval:Number = setInterval(checkTime, 1, stream_ns);
function checkTime(my_ns:NetStream) {
if (_root.my_video._alpha<100) {
_root.my_video._alpha += 1;
}
if (my_ns.time>duration-2 and _root.my_video._alpha>0) {
_root.my_video._alpha -= 1;
}
}
This flv file fade's in and out, but i have know idea what to do next.
I hope someone can help me with this problem.
thnx