32 Replies Latest reply on Nov 2, 2010 10:17 AM by kglad

    Rollover start with imported video

    Black Bumblebee Level 1

      HELP!

       

      My knowledge of Flash is very limited. I have it installed, but I've never used it as (quite frankly) it just seemed too confusing. So please keep this in mind...

       

      I do animation as a hobby on youtube (using a combination of Adobe Photoshop, Sony Vegas, and a few other programs for specifics such as morphing and mouth movements), and I was recently contacted by someone who wanted me to do some work for their website by making animation. The catch is, however, that they want my videos to be in flash format with the option to start playing (and repeat) when a person rolls over the scenes with their mouse.

       

      Now, I was able to figure out how to convert my videos into Flash F4V format (yea!), but I can't figure out for the life of me what to do next. All of the tutorials I've read talk about inserting buttons and changing instances and setting things to over and... it doesn't make a lick of sense to me.

       

      I'm not a dummy... but I've never used this program before, and a lot of the videos out there seem to assume a familiarity with the product.

       

      It "sounds" like it should be something easy and simple enough to do, but I must be missing something obvious here. Any ideas?

        • 1. Re: Rollover start with imported video
          kglad Adobe Community Professional & MVP

          create a fla, pick as2 or as3 for your actionscript version and use an flvplayback component to play your f4v(s).

          • 2. Re: Rollover start with imported video
            Black Bumblebee Level 1

            I'm sorry, I might not have been clear. I'm a newbie. I don't use this program normally.

             

            I have a video file that I have coverted to a flash video. I need to make a Flash player for it that won't start automatically, but will start once the viewer rolls their mouse over it, and stop when the viewer removes the cursor from it.

             

            I have been searching online and found discussions of rollover buttons and a few that show examples of using rollover starts, but they all seem to work under the assumption that the user is familiar with the program. I know there's gotta be a set formula to plug in to different areas, but I don't know what it is exactly--I just keep trying to adapt (blindly) what I see other people posting.

             

            I have VERY little experience with Flash.

            • 3. Re: Rollover start with imported video
              kglad Adobe Community Professional & MVP

              did you do what i suggested?

              • 4. Re: Rollover start with imported video
                Black Bumblebee Level 1

                I'm sorry kglad, but I cannot understand your instructions. I have a flash video. I picked Action Script 3. You then stated to use a flvplayback component to play my videos... but I have no idea where that is, as I do not see it anywhere on the menus. I can import a video by using the Import Video section, if that is what you mean.

                • 5. Re: Rollover start with imported video
                  kglad Adobe Community Professional & MVP

                  click window/components to open the component panel.  find the flvplayback component in that panel and drag it to the stage.  while the component is still selected, enter an instance name in the properties panel.

                  • 6. Re: Rollover start with imported video
                    Black Bumblebee Level 1

                    Okay, I'm with you so far. I've got the FLV player loaded onto the stage. What's next?

                    • 7. Re: Rollover start with imported video
                      kglad Adobe Community Professional & MVP

                      use the instance name (eg, flv) you entered in the properties panel:

                       

                      flv.source="thefilenameofyourf4v.f4v";

                      flv.play();

                       

                      // note:  this is just a test to make sure you've assigned your component's instance name correctly and have the correct path/name to your f4v.  you should see your f4v playing moments after testing your swf.  if you do, you're ready for the next (and final) step:

                       

                       

                      replace the above code with:

                       

                      flv.source="thefilenameofyourf4v.f4v";

                      flv.autoPlay=false;

                      flv.addEventListener(MouseEvent.ROLL_OVER,rolloverF);

                       

                      function rolloverF(e:Event):void{

                      flv.play();

                      }

                      • 8. Re: Rollover start with imported video
                        Black Bumblebee Level 1

                        I think I must be putting this information in the wrong place, as when I test the file (using control + enter) I get an error in the compiler section:

                         

                        Scene 1, Layer 'Layer1', Frame 1, Line 1    1120: Access of undefined property flv.   Flv.source="movie1";

                        Scene 1, Layer 'Layer1', Frame 1, Line 1    1120: Access of undefined property flv.   flv.play();

                         

                        I think I'm getting close, though. If I can just figure out where the "recipe code" goes for the start movie with rollover, I'll be golden, and be able to start on my project.

                        • 9. Re: Rollover start with imported video
                          kglad Adobe Community Professional & MVP

                          click on your on-stage flv playback component to select it and in the properties panel assign the instance name, flv

                          1 person found this helpful
                          • 10. Re: Rollover start with imported video
                            Black Bumblebee Level 1

                            Okay, I have changed the name of the instance to flv.

                            • 12. Re: Rollover start with imported video
                              Black Bumblebee Level 1

                              It didn't seem to like me changing the name of the instance to flv. When I went back and typed in:  flv.source="flv"; flv.play(); I got an error message that says Error #2044: Unhandled skinError:. text=1000: Unable to make connection to server or to find FLV on server and just brings up a white screen

                              • 13. Re: Rollover start with imported video
                                kglad Adobe Community Professional & MVP

                                that's not the code i suggested.  look at the code i suggested that assigns a source file to your flv playback component.

                                • 14. Re: Rollover start with imported video
                                  Black Bumblebee Level 1

                                  flv.source="thefilenameofyourf4v.f4v";

                                  flv.play();

                                   

                                  Is the code you suggested.

                                   

                                  I changed the instance name to flv as you suggested

                                   

                                  I did a bonehead thing and thought that in your code where you put thefilenameofyourf4v.f4v, I was suppose to put the name of the instance, instead of the name of the video, but even then when I put:

                                   

                                  flv.source="flash.f4v";

                                  flv.play();

                                   

                                  it still doesn't play. I would think that Adobe Flash would need some way of knowing where my video file is in order to be able to play it, wouldn't it? I've got it saved on my desktop.

                                  • 15. Re: Rollover start with imported video
                                    Black Bumblebee Level 1

                                    I'm going to record what I'm doing on my screen and upload it to youtube so that you can see what I'm doing. It must be just some simple thing that I'm missing somewhere. Thanks for all your help and patience so far... I know that us newbies have to really mess with your patience levels lol. Video will be coming in just a few moments.

                                    • 16. Re: Rollover start with imported video
                                      kglad Adobe Community Professional & MVP

                                      yes, flash needs to know the path/name of your f4v.  that's why i wrote:

                                       

                                      // note:  this is just a test to make sure you've assigned your component's instance name correctly and have the correct path/name to your f4v.

                                      • 18. Re: Rollover start with imported video
                                        Black Bumblebee Level 1

                                        Ah, I see. Okay, then. I seem to have that part done.


                                        • 19. Re: Rollover start with imported video
                                          kglad Adobe Community Professional & MVP

                                          so, everything's working?

                                           

                                          if not, the steps in your video will only work if you're saving your publishing your flash files to your desktop.

                                          • 20. Re: Rollover start with imported video
                                            Black Bumblebee Level 1

                                            No, the "I see" was to your comment about

                                             

                                            yes, flash needs to know the path/name of your f4v.  that's why i wrote:

                                             

                                            //  note:  this is just a test to make sure you've assigned your  component's instance name correctly and have the correct path/name to  your f4v.

                                             

                                            I seem to not have the right "path" for it to find / load my video from my desktop. What I'm getting in my youtube video is where I am currently at.

                                            • 21. Re: Rollover start with imported video
                                              kglad Adobe Community Professional & MVP

                                              create a new directory.  save your fla in that directory (using file/save as/...)

                                               

                                              move your f4v from your desktop to that directory.   you can then use the file name (of your f4v) as the source of your flv instance without worrying about specifying the correct path.  retest.

                                              1 person found this helpful
                                              • 22. Re: Rollover start with imported video
                                                Black Bumblebee Level 1

                                                Alright! Now we're in business. It's bringing up the file with the general playback code, and I'm getting a type of rollover play with the 2nd code that you came up with.

                                                 

                                                My only issue is that it only seems to play when the mouse rolls over the play button itself--what I was told I need is a rollover for the whole video, with a looping feature.

                                                 

                                                This is VERY helpful, though. I'll definately have to throw some sort of shout-out to you, Kglad, when I start animating, because you're the only one who has been willing to take the time with this poor newbie.

                                                • 23. Re: Rollover start with imported video
                                                  kglad Adobe Community Professional & MVP

                                                  ok.  right click your topmost layer to the left of the timeline and click new layer.  with that (new top-most) layer selected click the rectangle tool and select no stroke and any color filll.  draw a rectangle anywhere anysize on-stage.

                                                   

                                                  in the properties panel assign the same x,y,width,height for your rectangle as your flv.  (the rectangle should completely cover your flv.)   still in the properties panel click style and select alpha and assign an alpha of zero.  now right click your transparent rectangle, select convert to symbol and select button.  in the properties panel (while your transparent button is still selected), assign an instance name (eg, flv_btn).

                                                   

                                                  finally change:

                                                   

                                                  flv.addEventListener(MouseEvent.ROLL_OVER,rolloverF);

                                                   

                                                  function rolloverF(e:Event):void{

                                                  flv.play();

                                                  }

                                                   

                                                  to:

                                                   

                                                  flv_btn.addEventListener(MouseEvent.ROLL_OVER,rolloverF);

                                                   

                                                  function rolloverF(e:Event):void{

                                                  flv.play();

                                                  }

                                                  • 24. Re: Rollover start with imported video
                                                    Black Bumblebee Level 1

                                                    Excellent! The rectangle now acts as its own button, and starts when I roll the mouse over it! I think I might have made some errors as I couldn't see a section to select no stroke, and my video has a white box with a thin black line behind it now. Also, I couldn't find an option to change alpha in the style section, however, I did see an alpha marked when I clicked the box color button, and I set that to zero. But I got 90 percent of it right!

                                                     

                                                    Right now it is doing most of what I need it to. The only things I need to change in order for it to be 'perfect' are to add some sort of command to make the video stop when the mouse isn't on it, for it to auto repeat while the mouse is still on it, and for the white box that I somehow created behind it to disappear.

                                                     

                                                    You are a total life saver.

                                                    • 25. Re: Rollover start with imported video
                                                      Black Bumblebee Level 1

                                                      Just figured out my mistake with the alpha thing and got the white box to disappear. So, now all I need is the auto looping command and the stop when no mouse is on it command.

                                                      • 26. Re: Rollover start with imported video
                                                        kglad Adobe Community Professional & MVP

                                                        select your button (by clicking it) and in the properties panel there will be an option to set its alpha to zero.  if you can tell me whether you're using cs3, cs4 or cs5 and i can tell you where to look in the properties panel.

                                                         

                                                        for the rest of your coding:

                                                         

                                                         

                                                        flv.autoRewind = true;

                                                        flv_btn.addEventListener(MouseEvent.ROLL_OVER,rolloverF);

                                                        flv_btn.addEventListener(MouseEvent.ROLL_OUT,rolloutF);

                                                         

                                                        function rolloverF(e:Event):void{

                                                        flv.play();

                                                        }

                                                        function rolloutrF(e:Event):void{

                                                        flv.stop();

                                                        }

                                                        • 27. Re: Rollover start with imported video
                                                          Black Bumblebee Level 1

                                                          I'm using the CS4 version of Flash--and, like I said, don't worry, I found the alpha bit

                                                           

                                                          The new code seems to get a bit scrambled on the third line. It says "1120: Access of undefined property rolloutF." I also wasn't sure if this code gets added onto the previous code, or if it replaces the previous code.

                                                           

                                                          Getting excited now. I can see the goal in sight!

                                                          • 28. Re: Rollover start with imported video
                                                            kglad Adobe Community Professional & MVP

                                                            there's a typo in my code:

                                                             

                                                            function rolloutrF(etc...

                                                             

                                                            should be

                                                             

                                                            function rolloutF(...

                                                            • 29. Re: Rollover start with imported video
                                                              Black Bumblebee Level 1

                                                              Sorry for not getting back to you sooner on this (family, work, etc.). Fixing the typo in the code fixed the problem of the video stopping when the mouse is not on video, and it does start again from the beginning when the mouse goes back on the video. But I'm still missing that looping feature that will get it to keep playing the same file while the mouse is on the video.

                                                               

                                                              So, just one last bit of help, and then you won't have to worry about me bothering you anymore

                                                              • 30. Re: Rollover start with imported video
                                                                kglad Adobe Community Professional & MVP

                                                                :

                                                                 

                                                                flv.autoRewind = true;

                                                                flv_btn.addEventListener(MouseEvent.ROLL_OVER,rolloverF);

                                                                flv_btn.addEventListener(MouseEvent.ROLL_OUT,rolloutF);

                                                                 

                                                                function rolloverF(e:Event):void{

                                                                flv.play();

                                                                }

                                                                function rolloutF(e:Event):void{

                                                                flv.stop();

                                                                }

                                                                 

                                                                flv.addEventListener(Event.COMPLETE,completeF);

                                                                 

                                                                function completeF(e:Event):void{

                                                                flv.play();

                                                                }

                                                                • 31. Re: Rollover start with imported video
                                                                  Black Bumblebee Level 1

                                                                  Thank you, thank you, thank you!

                                                                   

                                                                  That did it. The video is now doing everything that I need it to do. You are a total life saver. I will now be able to tell the client that I can make videos of this sort, and get myself my first gig at doing animation for a website. I'm a college English teacher by trade, and was recently bumped down to part-time status, so trust me when I say that the extra income from this project will definitely be helpful.

                                                                  • 32. Re: Rollover start with imported video
                                                                    kglad Adobe Community Professional & MVP

                                                                    you're welcome.

                                                                     

                                                                    (and, if you have the opportunity to accept a project well beyond your capabilities, you can sub-contract to me:  www.kglad.com)