Hi I am using an xml video player that does not use the flv component in flash but a video clip object. So unfortunately I cannot utilize the cue points feature. All I want to do is pause the flv at a certain point for a number of seconds, fade in some movieclips, then fade out the movieclips and resume the flv and move onto the next one.
I assumed it would be easy enough to use the existing timer to pause at a certain number of seconds.
Heres what I have so far
if (controls_mc.sound_time_mc.time_txt == 04){
ns.pause(true);
fadeImage(copy_txt,0,100,2)
}
heres the action-script to load the video
resetVideo = function () {
durationDisplay = “0:00”;
controls_mc.progress_mc.buffer_mc._xscale = 0;
controls_mc.progress_mc.played_mc._xscale = 0;
doPlay();
};
resetVideo();
// Video stream
var nc:NetConnection = new NetConnection(this);
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(defaultBuffer);
// Attach video stream
video_holder.videoClip.attachVideo(ns);
// Attach audio stream
video_holder.attachAudio(ns);
video_holder.videoClip.smoothing = true;
loadVideo = function () {
doHighlight();
// Get video data from XML
Aspect = xmlNode.childNodes[galleryID].childNodes[ID].attributes.Aspect;
toLoad = xmlNode.childNodes[galleryID].childNodes[ID].attributes.VideoClip;
Title.text = xmlNode.childNodes[galleryID].childNodes[ID].attributes.header;
subTitle.text = xmlNode.childNodes[galleryID].childNodes[ID].attributes.subheader;
galleryTitle.text = xmlNode.childNodes[galleryID].attributes.Name;
resetVideo();
ns.play(toLoad);
video_holder.preloader_mc._visible = true;
// Set 4:3 or 16:9 mode
if (Aspect == “16:9”) {
video_holder.videoClip._width = video_holder.bg_mc._width=video_holder.videoClip.o riginWidth;
video_holder.videoClip._height = video_holder.bg_mc._height=video_holder.videoClip. originHeight*0.75;
video_holder.videoClip._y = video_holder.bg_mc._y=(video_holder.videoClip.orig inHeight-video_holder.videoClip._height)/2;
} else {
video_holder.videoClip._width = video_holder.bg_mc._width=video_holder.videoClip.o riginWidth;
video_holder.videoClip._height = video_holder.bg_mc._height=video_holder.videoClip. originHeight;
video_holder.videoClip._y = video_holder.bg_mc._y=0;
}
// Video preloader and end of video detection for autoplay
ns.onStatus = function(obj) {
if (obj.code == “NetStream.Buffer.Full”) {
video_holder.preloader_mc._visible = false;
}
if (obj.code == “NetStream.Buffer.Flush”) {
video_holder.preloader_mc._visible = false;
}
if (obj.code == “NetStream.Buffer.Empty”) {
video_holder.preloader_mc._visible = true;
}
if (obj.code == “NetStream.Play.Start”) {
videoEnd = false;
}
if (obj.code == “NetStream.Play.Stop”) {
videoEnd = true;
controls_mc.bttnPlay.icon_mc.gotoAndStop(2);
video_holder.preloader_mc._visible = false;
if (!mouseIsDown && autoMode) {
doAutoPlay();
}
}
if (videoEnd) {
video_holder.preloader_mc._visible = false;
}
};
// Get video duration
ns.onMetaData = function(obj) {
duration = obj[“duration”];
var seconds2 = Math.round(duration%60);
if (seconds2<10) {
seconds2 = “0”+seconds2;
}
durationDisplay = +seconds2
};
};
//
// DETECT MOUSE DOWN
//
var mouseListener:Object = new Object(this);
mouseListener.onMouseUp = function() {
mouseIsDown = false;
};
mouseListener.onMouseDown = function() {
mouseIsDown = true;
};
// AUTO PLAY BUTTON
if (autoMode == false) {
select_mc.bttnPlay.icon_mc.gotoAndStop(2);
}
select_mc.bttnPlay.bttn.onPress = function() {
if (select_mc.bttnPlay.icon_mc._currentframe == 1) {
select_mc.bttnPlay.icon_mc.gotoAndStop(2);
autoMode = false;
} else {
select_mc.bttnPlay.icon_mc.gotoAndStop(1);
autoMode = true;
doAutoPlay();
}
};
//
// AUTOPLAY FUNCTION
//
doAutoPlay = function () {
ID += 1;
if (ID == galleryTotal) {
ID = 0;
galleryID += 1;
if (galleryID == total) {
galleryID = 0;
}
buildGallery();
} else {
loadVideo();
}
};
This may also be relevant
onEnterFrame = function () {
// Get video stream bytes loaded
percentage = Math.round(ns.bytesLoaded/ns.bytesTotal*100);
controls_mc.progress_mc.buffer_mc._xscale = percentage;
// Get video time
ns_seconds = ns.time;
minutes = Math.floor(ns_seconds/60);
seconds = Math.floor(ns_seconds%60);
if (seconds<10) {
seconds = “0”+seconds;
}
// Display current time
controls_mc.sound_time_mc.time_txt.text = minutes+":"+seconds+" / "+durationDisplay;
// Progress bar position
controls_mc.progress_mc.played_mc._xscale = Math.round(ns.time*100/duration);
};