13 Replies Latest reply on Jul 21, 2009 3:49 PM by Enigma229

    Creating a gallery of FLV movies

    Enigma229

      I have five 3d animations I did that are in FLV format that I want to put up on my portfolio website. Any suggestions on the best way to do this in Flash CS4? Should I create it as if it were an image slideshow?

        • 1. Re: Creating a gallery of FLV movies
          kglad Adobe Community Professional & MVP

          create a posterframe for each one and when clicked play that flv.

          • 2. Re: Creating a gallery of FLV movies
            Enigma229 Level 1

            So you are saying I can create a thumbnail for each FLV and when the user clicks on that then the video will appear and play?

            • 3. Re: Creating a gallery of FLV movies
              kglad Adobe Community Professional & MVP

              well, the video won't magically appear and play.  you'll need to code for that.  that's not difficult but varies from as2 to as3 and depends on what you're using to play the videos.

              • 4. Re: Creating a gallery of FLV movies
                Enigma229 Level 1

                Yes I am using AS 3.0 in CS4. I tried some code on this site but I can't get the FLV component to appear ONLY when I press the thumbnail.

                • 5. Re: Creating a gallery of FLV movies
                  Enigma229 Level 1

                  I got it to work by creating some frame labels and telling the Poster Frame button to goto each label where the specific FLV is.

                   

                  However, I would like to have it so that the current FLV video will STOP playing if I click on another Poster Frame button. Any ideas?

                  • 6. Re: Creating a gallery of FLV movies
                    kglad Adobe Community Professional & MVP

                    if you want to have another frame in your swf display the videos, add the flvplayback component to one frame (labeled "video", for example) and give it an instance name, say flv.  in the video frame, use

                     

                    flv.source=flvSource;

                     

                    when you click on a posterframe button assign the string variable flvSource.  for example:

                     

                    var flvSource:String;

                     

                    flv1Btn.sourceS="flvnameforbutton1.flv";

                    flv2Btn.sourceS="flvnameforbutton2.flv";

                    etc

                     

                    then for each button:

                     

                    flv1Btn.addEventListener(MouseEvent.CLICK,f);

                    flv2Btn.addEventListener(MouseEvent.CLICK,f);

                    etc

                     

                    function f(e:MouseEvent){

                    flvSource=e.currentTarget.sourceS;

                    gotoAndStop("video);

                    }

                    • 7. Re: Creating a gallery of FLV movies
                      Enigma229 Level 1

                      Here is the code I put into frame with a label of "video":

                       

                      stop();
                      flv.source=flvSource;

                      var flvSource:String;

                      flv1Btn.source="movie01.flv";
                      flv2Btn.source="movie02.flv";
                      flv3Btn.source="movie03.flv";

                      flv1Btn.addEventListener(MouseEvent.CLICK, myVideo01);
                      flv2Btn.addEventListener(MouseEvent.CLICK, myVideo02);
                      flv3Btn.addEventListener(MouseEvent.CLICK, myVideo03);

                      function myVideo01(event:MouseEvent)
                      {
                          flvSource = event.currentTarget.source;
                          gotoAndStop("video");
                      }

                      function myrVideo02(event:MouseEvent)
                      {
                          flvSource = event.currentTarget.source;
                          gotoAndStop("video");
                      }

                      function myVideo03(event:MouseEvent)
                      {
                          flvSource = event.currentTarget.source;
                          gotoAndStop("video");
                      }

                       

                      The video does not load up.

                      I put everything (the FLV component and the Frame Poster buttons) in the same frame "video".

                       

                      What am I doing wrong here?

                      • 8. Re: Creating a gallery of FLV movies
                        kglad Adobe Community Professional & MVP
                        // this is the only line that goes in the "video" frame

                         

                        flv.source=flvSource;

                         

                        // the lines below should be on the first keyframe where your buttons appear

                         

                        var flvSource:String;

                         

                        flv1Btn.sourceS="flvnameforbutton1.flv";

                        flv2Btn.sourceS="flvnameforbutton2.flv";

                        etc

                         

                        then for each button:

                         

                        flv1Btn.addEventListener(MouseEvent.CLICK,f);

                        flv2Btn.addEventListener(MouseEvent.CLICK,f);

                        etc

                         

                        // there only needs to be one listener function for all your buttons

                         

                        function f(e:MouseEvent){

                        flvSource=e.currentTarget.sourceS;

                        gotoAndStop("video);

                        }

                        • 9. Re: Creating a gallery of FLV movies
                          Enigma229 Level 1

                          I did that and when I play it only the Flv that is associated with the first button I click.

                           

                          Here is what I have in the first frame (with a label of 'Main'):

                           

                          stop();

                          var flvSource:String;

                          myBtn.sourceS = "video01.flv";
                          myBtn2.sourceS = "video02.flv";
                          myBtn3.sourceS = "video03.flv";

                          myBtn.addEventListener(MouseEvent.CLICK, myVideo);
                          myBtn2.addEventListener(MouseEvent.CLICK, myVideo);
                          myBtn3.addEventListener(MouseEvent.CLICK, myVideo);

                          function myVideo(e:MouseEvent)
                          {
                              flvSource = e.currentTarget.sourceS;
                              gotoAndStop("video");
                          }

                           

                          The only other frame I have in this file is the one labeled 'video' and I I put this code in there:

                           

                          flv.source=flvSource;

                          • 10. Re: Creating a gallery of FLV movies
                            kglad Adobe Community Professional & MVP

                            if your buttons don't exist after clicking one of them, their sourceS property and button handlers will no longer be defined.

                            • 11. Re: Creating a gallery of FLV movies
                              Enigma229 Level 1

                              I'm not sure I follow so I am posting an example layout FLA file and maybe this will help.

                               

                              example.fla

                               

                               

                               

                               

                              • 12. Re: Creating a gallery of FLV movies
                                Enigma229 Level 1

                                Ok, using the following code I found on another help site I got it to work.

                                 

                                home_btn.addEventListener(MouseEvent.CLICK, navigate);
                                about_btn.addEventListener(MouseEvent.CLICK, navigate);
                                map_btn.addEventListener(MouseEvent.CLICK, navigate);
                                donate_btn.addEventListener(MouseEvent.CLICK, navigate);

                                function navigate(event:MouseEvent):void
                                {
                                     if(event.target == home_btn)
                                     {
                                          main_mc.gotoAndPlay(1);
                                     }
                                     else if(event.target == about_btn)
                                     {
                                          main_mc.gotoAndPlay(5);
                                     }
                                     else if(event.target == map_btn)
                                     {
                                          main_mc.gotoAndPlay(10);
                                     }
                                     else if(event.target == donate_btn)
                                     {
                                          main_mc.gotoAndPlay(15);
                                     }

                                }

                                For some reason when I keep 'Autoplay' on the FLV component, they stop playing when I click on another button.

                                • 13. Re: Creating a gallery of FLV movies
                                  Enigma229 Level 1

                                  AHHHHHHHHHHHHHHHH! I spoke too soon.

                                   

                                  At first that script works but if I keep clicking on the same button it loads a different FLV and keeps playing the old one!