2 Replies Latest reply on Sep 4, 2007 11:34 PM by Greg Dove

    write code to control video

      i´m doing an offline project where i´m calling flv files in different frames.
      Want I need is to say that when a specific video finishes(that is on frame10), i want to go to the my main menu:let´s say frame 2.
      I using a FLV PLayback to run the videos! and calling the videos using the contentpath on the components inspector.
      Do I have to use cuepoints?
      How to I code it?

      Please help me!!!

        • 1. Re: write code to control video
          dr.Evol Level 1
          You dont need to use cuepoints if you dont want to. You can just check the playtime and do some actions when you reach a specified time:

          var myPlayerListener:Object = new Object();
          myPlayerListener.change = function(eventObj:Object) {
          var myPosition:Number = myPlayer.playheadTime;
          if(myPosition==10) { //when you reach 10 seconds...
          // DO SOMETHING... mainMenu.gotoAndPlay(2) for example..
          myPlayer.addEventListener("change", myPlayerListener);

          .. and myPlayer is your FLVplayback instance name..
          • 2. Re: write code to control video
            Greg Dove Level 4
            @dr.Evol I don't think from the description it is intended to be 10seconds of video - or if so perhaps the event you intended for that code is 'playheadUpdate' and not 'change'?

            @petraf using dr.Evol's approach, but from your description I believe you want your FLVPlayback on frame 10 to listen for the FLVPlayback's 'complete' event and then goto frame 2.... if so then you can adjust the code as follows:

            var myPlayerListener:Object = new Object();
            myPlayerListener.complete= function(eventObj:Object) {
            // DO SOMETHING... mainMenu.gotoAndPlay(2) for example..
            myPlayer.addEventListener("complete", myPlayerListener);