11 Replies Latest reply on Mar 27, 2010 6:57 PM by kglad

    on end of flv playback go to....

    ggaarde Level 1

      Hello

       

      I am in the final stages of building my new web site:

       

      http://gggraphic.com

       

      On most of the pages in the portfolio there is a video "Commentary" link (top right corner)

       

      Each of the commentaries are flv called up by

      f.ex:

       

      myMCL.loadClip("http://www.gggraphic.com/new2/new2_flash/new2_brand3.swf",45);

       

      Once the video is done playing, it fades to black.

       

      I would really like the flv to trigger an event to send the playhead to another frame and load another swf.

       

      I could use a pause command and let the main time line pause so many milliseconds and then proceed, but it is probably not consistent how long it takes each viewer to download the video and watch it.

       

      An event handler at the end of the flv would be better.

       

      Can anyone tell me the simplest way to do this?

       

      I am using AS2

       

      Thank you on beforehand.

       

      ggaarde

        • 1. Re: on end of flv playback go to....
          Ned Murphy Adobe Community Professional & MVP

          Assuming you are actually playing an flv file in an FLVPlayback component in the swf file that you are loading, the FLYPlayback component  has a complete event that you can set up a listener for, and use theat to trigeer some action...

           

          var listenerObject:Object = new Object();
          listenerObject.complete = function(eventObject:Object):Void {
              // insert event-handling code here
          };
          my_FLVplybk.addEventListener("complete", listenerObject);
          
          • 2. Re: on end of flv playback go to....
            kglad Adobe Community Professional & MVP

            if you're using the flvplayback component, it has a complete event you can use.

            • 3. Re: on end of flv playback go to....
              ggaarde Level 1

              Hi Ned Murphy    

               

              Yes I am using the FLV Playback component.

               

              Would i enter your code on the same frame that calls up the FLV?

              Or in the first frame of the navigation movie?

               

               

              This is the AS in the frame that loads the movie:

               

               

               

              myMCL.loadClip("http://gggraphic.com/new2/new2_flash/new2_brand3.swf",45);

              • 4. Re: on end of flv playback go to....
                ggaarde Level 1

                Hi Kglad

                Could  you elaborate on your reply?

                 

                 

                 

                 

                 

                Ned Murphy suggested this script:

                 

                 

                var 
                
                listenerObject
                :Object = new Object(); 
                
                listenerObject
                .complete = function(
                
                eventObject:
                Object):Void { 
                
                    // insert event-handling code here
                 }; 
                my_FLVplybk.addEventListener("complete", 
                
                listenerObject
                );


                 

                 

                 

                I am in doubt where to place the script (same frame that loads the external swf?)  and which event handling code to use.

                 

                can I just add gotoAndPlay(245);      ?

                • 5. Re: on end of flv playback go to....
                  ggaarde Level 1

                  Hi Again Kglad, or anybody...

                   

                  I tried the following on the frame that loads the about us movie:

                   

                  it is loading the movie OK but it is not going anywhere after...

                   

                   

                   

                   

                   

                   

                  unloadMovieNum(45);

                   

                  myMCL.loadClip("http://www.gggraphic.com/new2/new2_flash/new2_com_about.swf",45);

                   

                   

                   

                   

                   

                  var listenerObject:Object = new Object();

                  listenerObject.complete = function(eventObject:Object):Void {

                   

                   

                  gotoAndPlay(30);

                   

                  };

                  my_FLVplybk.addEventListener("complete", listenerObject);

                  Should the listener be in the beginning of my naviation swf? and if so what should I put in the frame that loads my movie?
                  ggaarde

                  • 6. Re: on end of flv playback go to....
                    ggaarde Level 1

                    I can only make this work with a pause script.

                     

                    I can not get Ned Murphy's script to work.

                     

                     

                    Somebody, Please tell me exactly how and in which frame I add a listener and the goto command to make the end of my flv movie trigger my playhead to go to another frame so I can offer a continued experience.

                     

                    Please see what I am looking for on my site:

                     

                    www.gggraphic.com

                     

                    Go to Info > about > commentary

                     

                    Or

                     

                    Go to

                    brand > commentary

                     

                    The playhead pauses for a given time and then goes to a frame to continue the main flash timeline after the video.

                     

                    Only problem the video will load at different speeds and the system is not offering af consitant pause between the flv and the shift to the frame i assigned.

                     

                    Thank you so much on beforehand

                     

                    ggaarde

                    • 7. Re: on end of flv playback go to....
                      kglad Adobe Community Professional & MVP

                      this code:

                       

                      var listenerObject:Object = new Object();

                      listenerObject.complete  = function(eventObject:Object):Void {

                       

                       

                      gotoAndPlay(30);

                       

                      };

                      my_FLVplybk.addEventListener("complete",  listenerObject);

                       

                      needs to be in the same timeline as my_FLVplybk and it can't execute until my_FLVplybk exists.  and, if that timeline is not the one you want to direct to frame 30, you need to use the correct path to that timeline.

                      • 8. Re: on end of flv playback go to....
                        ggaarde Level 1

                        Hi Kglad

                         

                        Thank you for your answer again.

                         

                        My main (navigation) swf - in frame 70 - calls up an external swf by using this code:

                         

                        myMCL.loadClip("http://www.gggraphic.com/new2/new2_flash/new2_resume1.swf",45);

                        After the new2_resume1.swf ends playing its flv, I want the playhead to go to frame 60 in the main (navigation) swf.
                        As I understand from your post I need to enter your code in the external swf that contains the video component? Correct?
                        I have given the component the instance name of com_resume
                        I am using this script in the first frame of the new2_resume1.swf :
                        var listenerObject:Object = new Object();
                        listenerObject.complete  = function(eventObject:Object):Void {
                        _parent.gotoAndPlay(60);
                        };
                        com_resume.addEventListener("complete",  listenerObject);
                        This does not work.
                        I am not sure if it is because I use _parent.  if this is not a real parent child relationship.?
                        Should I use a complete url such as:
                        and add .gotoAndPlay(60);
                        Or what am I doing wrong?
                        ggaarde

                        • 9. Re: on end of flv playback go to....
                          kglad Adobe Community Professional & MVP

                          the code can be anywhere.  you just need to use the correct paths.

                           

                           

                          for your setup use:

                           


                          var listenerObject:Object = new Object();
                          listenerObject.complete   = function(eventObject:Object):Void {
                          _level0.gotoAndPlay(60);
                          };
                          com_resume.addEventListener("complete",   listenerObject);
                          • 10. Re: on end of flv playback go to....
                            ggaarde Level 1

                            Hi Kglad

                             

                            Thank you so much for sticking with my question.

                            What a beautiful thing that you can use the levels to address different swfs! I did not know that.

                             

                             

                            It works - you made my day!

                             

                            Many thanks.

                             

                            ggaarde

                            • 11. Re: on end of flv playback go to....
                              kglad Adobe Community Professional & MVP

                              you're welcome.

                               

                              p.s.  if your're still able, please mark this thread as answered.