Skip navigation
MARKARKARK
Currently Being Moderated

Text, still or movie clip plays before video.

Aug 16, 2012 2:30 PM

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.


 
Replies
  • Currently Being Moderated
    Aug 16, 2012 4:45 PM   in reply to MARKARKARK

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points