1 Reply Latest reply on Oct 17, 2007 4:20 PM by Kickpedal99

    Using Cue Points with FLV and AS

    Kickpedal99
      I have an FLV and I want to have several cue points, each will "cue" different text to appear.

      I have a movie clip on my stage (instance name "hello") which is set to not be visible until the 5 second mark of the video, where the cue point "sayHello" tells the clip "hello" to become visible.
      The AS on frame 1 looks like this:

      stop();
      hello._visible = 0;
      var listenerObject:Object = new Object();
      listenerObject.cuePoint = function(eventObject:Object):Void {
      hello._visible = 1;
      }
      vid_evan.addEventListener("cuePoint", listenerObject);

      This works fine and I'm happy (I'm not a coder so I grabbed the code from http://www.mediacollege.com/flash/video/cuepoints.html for this).

      However, at the 10 second mark of the video, I want the clip instance "hello" to go to frame 2. I've added the cue point "sayGoodbye" but I can't seem to create code that works for more than the one cue point action.

      Can anyone help please?
      Thanks.

      JP
        • 1. Re: Using Cue Points with FLV and AS
          Kickpedal99 Level 1
          OK...for those reading this who may have the same problem, I found the answer on the net in a Flashkit forum...

          The AS now looks like this:

          stop();
          hello._visible = 0;
          var listenerObject:Object = new Object();
          listenerObject.cuePoint = function(eventObject:Object):Void {
          if ( eventObject.info.name == "sayHello"){
          hello._visible = 1;
          }
          if ( eventObject.info.name == "sayGoodbye"){
          hello.gotoAndPlay(2);
          }
          if ( eventObject.info.name == "sayThisWorksNow!"){
          hello.gotoAndPlay(3);
          }
          }
          vid_evan.addEventListener("cuePoint", listenerObject);


          One would just need to add another 'if' statement like:
          if ( eventObject.info.name == "sayThisWorksNow!"){
          hello.gotoAndPlay(3);
          }
          for each cue point they've added, where everything in the quotes is your cue point name in the cue points dialogue box.