A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: can i jump to another frame when my video is done ????

  1. #1
    Member
    Join Date
    Feb 2005
    Location
    copenhagen
    Posts
    72

    can i jump to another frame when my video is done ????

    hi im making a website with a video as a intro for the website !!

    im streamimg the movie via a flv player witch works fine, but is there anyway i can make flash jump to another frame when the video is finished something like : if(myvideo.flv.complete) {
    gotoAndStop(2);

    im pretty stuck here

    here is the code i have used for my video:

    var nc:NetConnection = new NetConnection();
    nc.connect(null);

    var ns:NetStream = new NetStream(nc);

    theVideo.attachVideo(ns);

    ns.setBufferTime(10);

    ns.onStatus = function(info) {
    trace(info.code);
    if(info.code == "NetStream.Buffer.Full") {
    bufferClip._visible = false;
    }
    if(info.code == "NetStream.Buffer.Empty") {
    bufferClip._visible = true;
    }
    if(info.code == "NetStream.Play.Stop") {
    ns.seek(0);
    }

    }

    ns.play("mavideo.flv");

    playButton.onRelease = function() {
    ns.pause();
    }

    rewindButton.onRelease = function() {
    ns.seek(0);
    }

    var videoInterval = setInterval(videoStatus,100);
    var amountLoaded:Number;
    var duration:Number;

    ns["onMetaData"] = function(obj) {
    duration = obj.duration;
    }

    function videoStatus() {
    amountLoaded = ns.bytesLoaded / ns.bytesTotal;
    loader.loadbar._width = amountLoaded * 208.9;
    loader.scrub._x = ns.time / duration * 208.9;

    }

    var scrubInterval;

    loader.scrub.onPress = function() {
    clearInterval(videoInterval);
    scrubInterval = setInterval(scrubit,10);
    this.startDrag(false,0,this._y,208,this._y);

    }

    loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
    clearInterval(scrubInterval);
    videoInterval = setInterval(videoStatus,100);
    this.stopDrag();
    }

    function scrubit() {
    ns.seek(Math.floor((loader.scrub._x/208)*duration));
    }
    stop()
    - - - - - - - -

  2. #2
    Senior Member
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    348
    Yes.

    It's called the VideoEvent.COMPLETE event.

    you can find it by searching the livedocs for "FLVPlayback" or "VideoEvent".

    You might also like to search the forum too....

    Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center