A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: cue points, flv, interaction

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    45

    cue points, flv, interaction

    Hello,

    I have a streaming movie within a flash file and through the use of cue points I have the info in the flash movie (seemingly) reacting to the video. What I want to do is to be able to have the user scroll back and forth in the streaming movie to review the information presented. However, if the streaming movie timeline control is moved, everything then becomes out of synch. Obviously not what I want. If it's just played all is fine, but as I say I need to have the user interact by rewinding and fast forwarding the streaming movie while still maintaining the appropriate information that is running in the flash movie.

    Hope that makes sense. Does anyone know how this could be done?


    Thanks in advance,
    T

  2. #2
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    do you have any example code or FLA's that you could share to better illustrate the problem. I think I understand what you are trying to do, but it would be easier to see an example.
    moo

  3. #3
    Member
    Join Date
    Jul 2002
    Posts
    45
    Help I'm falling off the cliff of the first few pages...

    anyone have any idea on where to start?

    Thanks,
    T

  4. #4
    Senior Member
    Join Date
    Oct 2003
    Posts
    1,354
    There are a few events and properties of the flvPlayback class that will work. The SEEKED event dispatches when the playhead is changed by the user via the seek bar. When it is dispatched, you can find the closet cue point back in time using the 'findNearestCuePoint()' method. Then write your function to display the rest of your flash movie based on what is returned.

    Here is an example tracing cuePoints and tracing the nearest cue points when a SEEKED event is dispatched.

    Code:
    //Where there is a flvPlayBack component named 'myVid' with several event cuepoints embeded. 'myVid' has a skin which includes a seek bar
    myVid.addEventListener(MetadataEvent.CUE_POINT, cuePointListener);
    
    function cuePointListener(event:MetadataEvent):void {
    	trace("//// cuePointListener ////");
    	trace("Elapsed time in seconds: " + myVid.playheadTime);
    	trace("Cue point name is: " + event.info.name);
    	trace("Cue point type is: " + event.info.type);
    }
    
    myVid.addEventListener(VideoEvent.SEEKED, lastCuePoint);
    function lastCuePoint(event:Event):void {
    	var rtn_obj:Object = new Object();
    	rtn_obj = myVid.findNearestCuePoint(myVid.playheadTime);
    	trace(".... playhead seeked ....");
    	trace("Cue point name is: " + rtn_obj.name);
    	trace("Cue point time is: " + rtn_obj.time);
    	trace("Cue point type is: " + rtn_obj.type);
    }
    // The SEEKED event will dispatch when the user moves the seek bar.  You could also use the PLAYHEAD_UPDATE which will dispatch much more often.
    //myVid.addEventListener(VideoEvent.PLAYHEAD_UPDATE lastCuePoint);
    At this point, I only know a bit about the flvPlayback component, if you are not using the component, i am sure that there are similar events,methods and properties in the class you are using.

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