A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: using Cue Points in Video question

  1. #1
    Junior Member
    Join Date
    May 2006
    Location
    Nashville, TN
    Posts
    11

    using Cue Points in Video question

    I have a imported a video into my flash movie and placed a cue point at the end of the video so that it will be called when the movie is over and send the timeline back to frame one. I thought this was going to be a lot easier than it has turned out to be. I just cant seem to get it to work and have not been able to find any tutorials on the subject.
    ANY help would be much appreciated.

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Posts
    12

    set autoRewind to true?

    Have you tried setting the component settings on the FLVPlayback - specifically autoRewind to true?

  3. #3
    Junior Member
    Join Date
    May 2006
    Location
    Nashville, TN
    Posts
    11
    I want the timeline to go back to the first frame in the timeline not the first frame in the video that I have imported. I am having the video stream from the server and I am trying to go to a different frame in the Flash Timeline when the video is finished playing, not rewind back to the start of the video
    Last edited by johnsontb; 11-30-2006 at 06:25 PM.

  4. #4
    Junior Member
    Join Date
    Aug 2006
    Posts
    12
    Does the video reside on one frame of the timeline or do you have it playing with other events on the timeline?

  5. #5
    Junior Member
    Join Date
    May 2006
    Location
    Nashville, TN
    Posts
    11
    the video only takes up one frame of the timeline.

  6. #6
    Junior Member
    Join Date
    Aug 2006
    Posts
    12
    In my experience, you must have the video spread over a couple frames of the timeline, with a keyframe in the middle (on another layer), telling the timeline to stop, putting another key frame at the end of the video with the name of the cue point as the frame lable, with actionScript command you want. You may also need to cut and paste the following ActionScript code on the first frame of the video (on same layer as you are putting the other keyframes) for the video to recognise the cue point name on the time line:

    // Is this a screens document or not?
    var uses_screens:Boolean = false;
    stop();

    // *************************
    // Navigation buttons call this function to trigger a change
    // in the video and the view of the content
    function seekToCuePoint( cueName ) : Void
    {

    // If the video is currently stopped, then play it
    if(!display.playing ){
    display.play();
    }

    // Find the cue point in the FLVPlayback component, seek
    // to time, and highlight the next button for a quick redraw
    var c = display.findCuePoint( cueName );
    display.seekSeconds( c.time );
    findNextButton( c.name );
    }

    // *************************
    // The natural flow through the video or jumping by seeking
    // forward and backward will trigger the following function
    function synchVideoToInterace( cueName:String ):Void
    {
    // Show associated content on screens or labeled frames
    if( uses_screens ){
    currentSlide.gotoSlide(this[ cueName ]);
    }else{
    gotoAndStop( cueName );
    }
    // Update the higlight position
    findNextButton( cueName );
    }

    // Layout the button highlight when requested
    function findNextButton( cueName:String ):Void
    {
    // Look for buttons named with the current cue point
    // name plus the letters '_btn' (i.e. studiomx_btn)
    var cueBtn = this[ cueName+"_btn" ];
    if( cueBtn != undefined )
    {
    // Attach the highlight clip if needed
    if( highlight_mc == undefined ){
    this.attachMovie("ThumbOutlineSelected","highlight _mc", 100);
    }
    highlight_mc._x = cueBtn._x;
    highlight_mc._y = cueBtn._y;
    }
    }

    // *************************
    // Create a listener object to catch events from
    // the video component and update the interface...
    var videoEventHandler:Object = new Object();
    videoEventHandler.cuePoint = function( evt:Object ):Void
    {
    // Get the cue name from the event object
    synchVideoToInterace( evt.info.name );
    }
    videoEventHandler.fastForward =
    videoEventHandler.rewind = function( evt:Object ):Void
    {
    // Get the cue name of the nearest cue point
    var nearestCue = evt.target.findNearestCuePoint(evt.playheadTime);
    synchVideoToInterace( nearestCue.name );
    }
    display.addEventListener("cuePoint",videoEventHand ler);
    display.addEventListener("fastForward",videoEventH andler);
    display.addEventListener("rewind",videoEventHandle r);




    Hope this Helps

  7. #7
    Junior Member
    Join Date
    May 2006
    Location
    Nashville, TN
    Posts
    11
    Thanks a lot for your help. I will give it a try and get back to you on if it works or not. again thank you so much for hleping me out.

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