A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: FLV cue points

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    45

    FLV cue points

    Hello,

    I have encoded my video and added 3 cue points, BEGIN, MIDDLE, END. What I would like to do is while the streaming movie is playing and it gets to the "MIDDLE" cue point, jump ahead to another frame in the timeline of my flash movie. Is there a way to do this without writing code from scratch? I'm not very good with code.
    Thanks,
    T

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Have you imported the video into your movie?
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Jul 2002
    Posts
    45
    Thanks for the response. Yes I have imported the video and it's in the timeline and I can see the cue points in the parameter window.

    What I'm trying to do (without writing code if possible) is have text next to the video that addresses what is going on at the beginning of the video. Then at the middle portion of the video (called "middle cue point") I was to go begin playing frames so that the middle text appears to go along with the middle of the video. So I would have a stop on frame 1 and when the middle cue point arrives in the streaming video the timeline would go to frame 2 and play until frame 20 at which point it will stop again.

    Hope this makes sense.

    Thank in advance,
    T

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I don't know you can actually do something with cuepoints when the video is imported. I know you can do something with cuepoints when the video is handled with actionscript. Without AS I think you can't do anything and it's not difficult. Check cuepoint in the flash helpfiles, onCuePoint method for video objects.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    I know you don't like the actionscript idea...but, maybe try this.

    As long as your cue points are set up as "Event" points and you are using the FLVPlayback component...adding an event Listener could work.

    Code in Frame 1 AS layer:
    Code:
    var MiddleCuePointListener:Object = new Object();
    MiddleCuePointListener.cuePoint = function(eventObject:Object):Void  {
    	if (eventObject.info.name == "MIDCUEPOINTNAME") {
    		gotoAndPlay(2);
    	}
    };
    FLVCOMPONENTNAME.addEventListener("cuePoint", MiddleCuePointListener);
    stop();
    Just change "MIDCUEPOINTNAME" to whatever you named your middle cuePoint and change "FLVCOMPONENTNAME" to whatever you name your FVLPlayback component. Then at frame 20 you can add your stop(); or whatever other function you want to occur. Play with that...see if that works or helps at all.

  6. #6
    Member
    Join Date
    Jul 2002
    Posts
    45
    Thanks for the reply caroach. I tried the code and I "think" I changed it in the right places, but it didn't seem to work. Could you confirm that I did this correctly?

    The name of my second cue point (the one I where I want the middle of the video to trigger the move to frame 2) is called:

    2_doors

    The name of my flv component is default:

    FLVPlayback
    (I'm not sure if you're talking about the component in the library or the content path to the video file, which is "superior_4_flash.flv")
    __________________________________________________ ___________

    var MiddleCuePointListener:Object = new Object();
    MiddleCuePointListener.cuePoint = function(eventObject:Object):Void {
    if (eventObject.info.name == "2_doors") {
    gotoAndPlay(2);
    }
    };

    FLVPlayback.addEventListener("2_doors", MiddleCuePointListener);
    stop();

  7. #7
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    I think we're getting close
    The FLVPlayback component is the component in the library. Rather than leaving the component name default, let's make our lives easier and give it a unique name like "playback_flv". Also, the name "cuePoint" at the end does not change to "2_doors" as it refers to our function, not the actual cue point we are listening for. So...try this:

    Code in frame 1 of AS layer:
    Code:
    var MiddleCuePointListener:Object = new Object();
    MiddleCuePointListener.cuePoint = function(eventObject:Object):Void  {
    	if (eventObject.info.name == "2_doors") {
    		gotoAndPlay(2);
    	}
    };
    playback_flv.addEventListener("cuePoint", MiddleCuePointListener);
    stop();
    Now...something else I'm thinking could cause a problem...once the FLV movie gets to the "2_doors" cue point, I don't know if the FLV playhead will continue to advance if the main Flash movie playhead is advancing to frame 20. Again, it's something I've never played with, so this may not be an issue.
    Try the code...see if it works...let me know.
    Thanks!

  8. #8
    Member
    Join Date
    Jul 2002
    Posts
    45
    Hi caroach,

    I copied the code and renamed the player, but I'm sorry to say it didn't work. It played the video as usual, but didn't advance the movie frame to 2. I appreciate your help with this. Let me know if you have any other ideas.

    Thanks,
    T

  9. #9
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Ckeck the comments in the bottom:

    http://livedocs.macromedia.com/flash...=00002582.html

    And you did not say that you are using the component. If you use the component don't import your video into the movie. Play it streaming. Probably it does not work because you have the video imported in the movie.
    Last edited by cancerinform; 12-18-2006 at 08:29 PM.
    - The right of the People to create Flash movies shall not be infringed. -

  10. #10
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    As an alternative....

    Swishvideo2 allows for event handlers in flv. which can be used as cue points.

    http://www.swishzone.com/index.php?a...ed&link_id=148

    http://www.swishzone.com/index.php?a...o&tab=overview

  11. #11
    Senior Member
    Join Date
    Sep 2000
    Posts
    272

    Don't know if you still needed anything......

    Took the code posted by caroach, and added some items. They all work, text into dynamic text field, and mclip slider_mc reacts to command in if statement 2. Don't know if this might help, but are your cuepoints set as Events or Navigation? Mine are set as Event.....

    Cheers

    var MyCuePointListener:Object = new Object();
    MyCuePointListener.cuePoint = function(eventObject:Object):Void {
    if (eventObject.info.name == "CP_1") {
    trace("this is cuepoint one");
    my_text.text = "This is cue point one, and this darn thing works";
    }
    if (eventObject.info.name == "CP_2") {
    trace("this is cuepoint two");
    my_text.text = "This is cue point two, oh man!";
    slider_mc.gotoAndStop(2);
    }
    if (eventObject.info.name == "CP_3") {
    trace("this is cuepoint three");
    my_text.text = "This is cue point tree, oh man, oh man!";
    }
    };
    my_flvPb.addEventListener("cuePoint", MyCuePointListener);
    Last edited by designforce; 12-19-2006 at 06:46 PM. Reason: l;eft out some info

  12. #12
    Member
    Join Date
    Jul 2002
    Posts
    45
    Hey Designforce,

    Not that I'm an expert, but this looks good. I really appreciate the work that you all have invested in my little problem.

    So if my cue points are:

    begin
    2_doors
    last

    Would I replace the following with the above?

    this is cuepoint one
    this is cuepoint two
    this is cuepoint three

    and lastly did you put the parentheses to bring attention to the cue points or are they (the parentheses around the cuepoints) part of the code?

    Thanks once more,
    T

  13. #13
    Senior Member
    Join Date
    Sep 2000
    Posts
    272

    Hey

    Look at this, where I have CP_1, etc is what you need to replace.

    So, you would put your cuepoint - begin in place of CP_1, and 2_doors in place of CP_2, and last in place of CP_3

    My Code:
    var MyCuePointListener:Object = new Object();
    MyCuePointListener.cuePoint = function(eventObject:Object):Void {
    if (eventObject.info.name == "CP_1") {
    trace("this is cuepoint one");
    my_text.text = "This is cue point one, and this darn thing works";
    }
    if (eventObject.info.name == "CP_2") {
    trace("this is cuepoint two");
    my_text.text = "This is cue point two, oh man!";
    slider_mc.gotoAndStop(2);
    }
    if (eventObject.info.name == "CP_3") {
    trace("this is cuepoint three");
    my_text.text = "This is cue point tree, oh man, oh man!";
    }
    };
    my_flvPb.addEventListener("cuePoint", MyCuePointListener);

    WHAT YOUR'S SHOULD LOOK LIKE REMEMBER, YOU DON'T NEED TRACE STATEMENTS, BUT THEY HELP DURING DEVELOPMENT.....

    var MyCuePointListener:Object = new Object();
    MyCuePointListener.cuePoint = function(eventObject:Object):Void {
    if (eventObject.info.name == "begin") {
    trace("this is the begin cue point");
    my_text.text = "This is cue point one, and this darn thing works";
    }
    if (eventObject.info.name == "2_doors") {
    trace("this is cuepoint 2_doors");
    my_text.text = "This is cue point two, oh man!";
    slider_mc.gotoAndStop(2);
    }
    if (eventObject.info.name == "last") {
    trace("this is cuepoint last");
    my_text.text = "This is cue point tree, oh man, oh man!";
    }
    };
    my_flvPb.addEventListener("cuePoint", MyCuePointListener);

  14. #14
    Member
    Join Date
    Jul 2002
    Posts
    45
    If I might follow up here.

    When I put this code into frame 1 it just plays through the movie. If I put a stop before your code on frame 1, it stops and doesn't continue when it hits the cue point "2_doors"

    Hmmm. Any other thoughts? Am I doing something wrong? I hope adobe can help the AS challenged on the next version with more icon based functions. arrrrrgggg!

    Thanks,
    T

  15. #15
    Senior Member
    Join Date
    Sep 2000
    Posts
    272

    Question Let me think....

    Can you post your code and state how you used it.

    That would save some time.

    ......

  16. #16
    Member
    Join Date
    Jul 2002
    Posts
    45
    sure. First off my player is called:
    myflvPb

    my cue points (are events) which I put in during encoding are

    begin
    2_doors
    charles

    In my timeline (in flash) I have 100 frames. what I want to have happen is on frame 1 the flash movie stops and the video plays. When the video gets to cue point 2 (2_doors), I want the flash movie to advance to frame 2 because on frame 2 I have text that will go along with what is happening in the video. I did not import the video, I'm using the flvPlayback (now called myflvPb) to access the flv movie which will be streaming.

    I have put the following code on frame 1 in my flash movie:

    var MyCuePointListener:Object = new Object();
    MyCuePointListener.cuePoint = function(eventObject:Object):Void {
    if (eventObject.info.name == "begin") {
    trace("this is the begin cue point");
    my_text.text = "This is cue point one, and this darn thing works";
    }
    if (eventObject.info.name == "2_doors") {
    trace("this is cuepoint 2_doors");
    my_text.text = "This is cue point two, oh man!";
    slider_mc.gotoAndStop(2);
    }
    if (eventObject.info.name == "last") {
    trace("this is cuepoint last");
    my_text.text = "This is cue point tree, oh man, oh man!";
    }
    };
    my_flvPb.addEventListener("cuePoint", MyCuePointListener);

  17. #17
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374

    Try this maybe

    So I made a little test movie to see if this helps you.
    Download the linked file and disect...
    See if it helps at all.

    Download File

  18. #18
    Member
    Join Date
    Jul 2002
    Posts
    45
    Hey Caroach,

    Much appreciated. That's exactly what I was trying to do!

    Sorry for the late thanks. The holidays...

    Thanks to all,
    T

  19. #19
    Member
    Join Date
    Jul 2002
    Posts
    45
    Hey all,

    If you have time and want to see your feedback at work:

    http://www.tomhepburn.com/digitalartist

    Thanks again

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