Hello,
I had posted before and closed out my post because I thought I had the correct answer. I don't mean to repost, I just don't know what else to do. I have a video that plays in a flash game with a background on another layer. I have cue points that jump to the next video when a cue point is reached. Before the video plays the background shows for a half a second or so, with text from another layer. I thought I had fixed the problem by putting my background and text into movie clips with the first 6 frames blank. This works sparadically, but then shows a blank page for the half second. In my prior post (sorry again) the suggestion was this code:
trace(bg1);
trace(q1);
bg1._visible=false;
var lo:Object = {};
lo.ready = function(eObj:Object):Void {
bg1._visible = true;
};
q1.addEventListener("ready", lo);
The code I am using is:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
q1.attachVideo(ns);
ns.play("http://www.mysite.org/1.flv");
ns.onCuePoint = function(evt:Object){
trace(evt.name);
trace(evt.time);
if(evt.name == "c1") {
trace("YO !Jump to 158!");
gotoAndPlay(158);
}
};
//-------Sound Controls--------//
this.createEmptyMovieClip("sound_mc",this.getNextHighestDepth());
sound_mc.attachAudio(ns);
var videoSound:Sound = new Sound(sound_mc);
videoSound.setVolume(100);
I have attempted to place the new code within what I have but this doesn't seem to work. My project is in actionscript 2.0
Again sorry for the repost, I tried to restart the last, but I thought it might be too old.
I thought I might have figured it out, I tried this:
trace(bg1);
trace(text1);
trace(q1);
bg1._visible=false;
text1._visible=false;
var lo:Object = {};
lo.ready = function(eObj:Object):Void {
bg1._visible = true;
text1._visible = true;
};
q1.addEventListener("ready", lo);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
q1.attachVideo(ns);
ns.play("http://www.mysite.org/1.flv");
ns.onCuePoint = function(evt:Object){
trace(evt.name);
trace(evt.time);
if(evt.name == "c1") {
trace("YO !Jump to 108!");
gotoAndPlay(108);
}
};
//-------Sound Controls--------//
this.createEmptyMovieClip("sound_mc",this.getNextHighestDepth());
sound_mc.attachAudio(ns);
var videoSound:Sound = new Sound(sound_mc);
videoSound.setVolume(100);
Again sorry for the repost, I tried to restart the last, but I thought it might be too old.
Thank you to everyone who has helped me with this, this seems to be my last obstacle with this project.
Mark.
If there is a half second before the video starts, what do you want to display?
Why is there a 1/2 second delay before the video... is that on purpose?
When jumping to a section of the timeline where a video plays, are there some frames that play before the video starts? some sort if transition or something?
I don't see any reason why the video should be delayed at all when jumping to a frame containing video.
Have you tried setting buffer time to 0
ns.setBufferTime(0);
Keep in mind that even a buffer time of zero will not exactly be zero if the video files is being downloaded over the Internet... there will be a short delay as the first part of the file downloads.
I don't know why it is doing this. I don't want this to happen. When the video hits the cue point and advances to the next video it displays the background first then plays the video. I have the background and the video on the same frame. I have tried to set it ahead the video, but it still does the same thing. I thought I had a solution, I had put the background in a movie clip with 6 to 24 frames ahead that were blank. So when the video starts tha background and text would be blank. This then made the background and text disappear but now there is a half a second of blank screen before the video plays.
Is there somewhere specific that I need to place this code?
Mark
North America
Europe, Middle East and Africa
Asia Pacific