7 Replies Latest reply on Sep 7, 2010 8:44 AM by irtony

    cue points

    irtony

      Hello. I have not worked with cue points before and I'm sure this has a simple solution. I have a very short video I have converted to flv with 2 cuepoints. I'm trying to get a movie clip to run at the first cue point, but my code isn't working right. I'm working in actionscipt 2 and flash cs4 and here is the script:

       

      cueListener.cuePoint = function(eventObject:Object):Void {

         if (eventObject.info.name=="recycle"){

            mc_recycle.gotoandPlay(1);

         }

         if (eventObject.info.name=="ASCuePt2"){

            stop();

         }

      }

       

       

      I want the video to only run once and not rerun, so I put the stop in. Can someone tell me what I'm doing wrong?

      Thanks!

        • 1. Re: cue points
          kglad Adobe Community Professional & MVP

          are you using as2?  did you instantiate cueListener?  are you using an flvplayback component?

           

          if yes to all, have you assigned your component to the listener?    that should look something like:

           

           

           

          flv.addEventListener("cuePoint",cueListener);

          • 2. Re: cue points
            irtony Level 1

            I'm using actionscript 3 on this. I have a flvplayback component and it does show the cuepoints. but whenever I try to get the movie clip to play it throws an error. should it be an event cue point or a navigation cue point?

            • 3. Re: cue points
              kglad Adobe Community Professional & MVP

              that's not as3 code.  you should be using the cuepoint metadataevent.  something like:

               

              import fl.video.MetadataEvent;

               

              yourflvpb.addEventListener(MetadataEvent.CUE_POINT,f);

               

              function f(e:MetadataEvent):void{

              //etc using e.info object

              }


              • 4. Re: cue points
                irtony Level 1

                ok. Can you talk me through this? I've never worked with flash as3 and video before. I have a movie with a cuepoint. I add it to the stage with a flvplayback component. I add an instance name of myVideo to the playback.  I want a movie clip to run when the cuepoint is hit. The movie clip has an instance name of trashcan. The cuepoint name is recycle2.

                I have looked at all the tutorials and explanations on adobe.com and elsewhere and I am thoroughly confused. Frankly, the creators of AS3 should be publicly flogged for making this so difficult.

                 

                Thanks.

                • 5. Re: cue points
                  kglad Adobe Community Professional & MVP

                  use:

                   

                   

                  import fl.video.MetadataEvent;

                   

                  myVideo.addEventListener(MetadataEvent.CUE_POINT,f);

                   

                  function f(e:MetadataEvent):void{

                  if(e.info.name=="recycle2"){

                  trashcan.play();

                  }

                  }

                  • 6. Re: cue points
                    irtony Level 1

                    It worked! Thank you so much!

                    • 7. Re: cue points
                      kglad Adobe Community Professional & MVP

                      you're welcome.