4 Replies Latest reply on Sep 28, 2006 1:23 PM by Newsgroup_User

    FLV Event Cue Point...Just can't get it?

    Licarell
      Here is my situation. I have an flv with two event cue points. I have placed a FLVPlayback into my movie and called the instance "my_video".

      All I want to do is have my "begin" cue point tell my movie to gotoAndStop at frame 18 and then the second cue point "white flash" to tell the movie to gotoAndPlay at frame 19.

      Thats it...I've poured over the help files and all over the forums and I still can't seem to get my head wraped around this.

      I'm usually pretty good at picking this stuff up but now I'm so frustrated and I can't think straight.

      Please help!!
        • 1. Re: FLV Event Cue Point...Just can't get it?
          Level 7

          "Licarell" <webforumsuser@macromedia.com> wrote in message
          news:efh6oe$8ab$1@forums.macromedia.com...
          > Here is my situation. I have an flv with two event cue points. I have
          > placed a
          > FLVPlayback into my movie and called the instance "my_video".
          >
          > All I want to do is have my "begin" cue point tell my movie to gotoAndStop
          > at
          > frame 18 and then the second cue point "white flash" to tell the movie to
          > gotoAndPlay at frame 19.
          >
          > Thats it...I've poured over the help files and all over the forums and I
          > still
          > can't seem to get my head wraped around this.
          >
          > I'm usually pretty good at picking this stuff up but now I'm so frustrated
          > and
          > I can't think straight.
          >
          > Please help!!
          >

          I did something similar to this a long time ago. There is some method in
          the FLVPlayback component that returns the current playhead time.

          So, you could run some sort of looping function (onEnterFrame and
          setInterval come to mind) which checks the current playhead time. Then, it
          would check against your values for the "cue points" and jump ahead.

          Something like... (not tested)

          var cueData:Array = [ {cue_time: 12.0, frame_label: "frame 2"}, {cue_time:
          24.0, frame_label: "frame 3"}];
          var cueIndex:Number = 0;

          var siID:Number = setInterval(checkPlayhead, 100);

          function checkPlayhead() {
          var myCueData:Object = cueData[cueIndex];
          var currentTime:Number = myFLVPlaybackComponent.playheadTime;
          if (currentTime >= myCueData.cue_time) {
          cueIndex ++;
          if (cueIndex >= cueData.length) {
          clearInterval(siId);
          }
          }
          }





          • 2. Re: FLV Event Cue Point...Just can't get it?
            Level 7

            "SMB" <mailer@forums.com> wrote in message
            news:efh935$b95$1@forums.macromedia.com...
            >
            > "Licarell" <webforumsuser@macromedia.com> wrote in message
            > news:efh6oe$8ab$1@forums.macromedia.com...
            >> Here is my situation. I have an flv with two event cue points. I have
            >> placed a
            >> FLVPlayback into my movie and called the instance "my_video".
            >>
            >> All I want to do is have my "begin" cue point tell my movie to
            >> gotoAndStop at
            >> frame 18 and then the second cue point "white flash" to tell the movie to
            >> gotoAndPlay at frame 19.
            >>
            >> Thats it...I've poured over the help files and all over the forums and I
            >> still
            >> can't seem to get my head wraped around this.
            >>
            >> I'm usually pretty good at picking this stuff up but now I'm so
            >> frustrated and
            >> I can't think straight.
            >>
            >> Please help!!
            >>
            >
            > I did something similar to this a long time ago. There is some method in
            > the FLVPlayback component that returns the current playhead time.
            >
            > So, you could run some sort of looping function (onEnterFrame and
            > setInterval come to mind) which checks the current playhead time. Then,
            > it would check against your values for the "cue points" and jump ahead.
            >
            > Something like... (not tested)
            >
            > var cueData:Array = [ {cue_time: 12.0, frame_label: "frame 2"}, {cue_time:
            > 24.0, frame_label: "frame 3"}];
            > var cueIndex:Number = 0;
            >
            > var siID:Number = setInterval(checkPlayhead, 100);
            >
            > function checkPlayhead() {
            > var myCueData:Object = cueData[cueIndex];
            > var currentTime:Number = myFLVPlaybackComponent.playheadTime;
            > if (currentTime >= myCueData.cue_time) {
            > cueIndex ++;
            > if (cueIndex >= cueData.length) {
            > clearInterval(siId);
            > }
            > }
            > }
            >

            Whoops... I guess this shows how long it has been for me. I don't remember
            FLVPlayback having cuePoints as part of its class... but anyway. In the
            help docs it shows them using a listener for the event of a cuePoint (this
            makes a lot more sense) to have the FLVPlayback broadcast hitting a cuePoint
            rather than having some other function checking.

            So, from the docs it would be more like (again not tested)

            ** assumes your movie clip instance is named my_movie and your FLVPlayback
            is my_video.

            my_movie.my_video.addASCuePoint(12.0, "frame 2");
            my_movie.my_video.addASCuePoint(24.0, "frame 3");
            // Now you have cue points that the FLVPlayback knows about, and when it
            gets to the cuePoint time it will fire off the cuePoint event... so

            var listerObject:Object = new Object();
            listenerObject.cuePoint = function(eventObject:Object):Void {
            use eventObject here...
            }
            my_movie.my_video.addEventListener("cuePoint", listenerObject);


            • 3. Re: FLV Event Cue Point...Just can't get it?
              Peter Lorent Level 2
              Try attached code.

              • 4. Re: FLV Event Cue Point...Just can't get it?
                Level 7

                "LuigiL" <webforumsuser@macromedia.com> wrote in message
                news:efhaq9$dca$1@forums.macromedia.com...
                > Try attached code.
                >
                >
                >
                > //use an object to listen for events
                > var myDisplayListener:Object=new Object();
                > //add event cuePoint to the object
                > myDisplayListener.cuePoint=function(eventObj:Object){
                > var index=eventObj.target.name;
                > if(index=="begin"){
                > _level0.gotoAndStop(18);
                > }
                > if(index=="white flash"){
                > _level0.gotoAndPlay(19);
                > }
                > }
                > //set up the listener
                > my_video.addEventListener("cuePoint",myDisplayListener);
                > //add a cuepoint
                > my_video.addCuePoint("begin",0);//set correct duration in seconds for 0
                > my_video.addCuePoint("white flash",30);//set correct duration in seconds
                > for 30
                >

                I think the name and time need to be reversed in the addCuePoint calls.