5 Replies Latest reply on May 25, 2012 12:42 PM by sinious

    Flash ForwardButton and BackButton Component Help Please


      Hi all,


      I was setting up a video with Navigation Cue points thinking that the ForwardButton and BackButton would actually move forward and back based on the navigation cues. Well, they don't do anything at all it seems. Can anybody explain what the function of the ForwardButton and BackButtons are? How do I use them?


      I'd like to set up a video to simply have a next and previous button (they must say next and previous not just be buttons that look like it). Any thoughts? Has anybody done this in the past?

        • 1. Re: Flash ForwardButton and BackButton Component Help Please
          sinious Most Valuable Participant

          From a high level, components largely do nothing themselves and are typically just MovieClips with premade functionality.


          What you want to do will require some custom coding. For instance when you drop the component on the stage it doesn't know which video you want it to control. You have to assign it. That's why it does nothing.


          Sometimes the Component Inspector panel has enough "premade" functionality and custom options to let you get up and running quickly such as the FLVPlayback component. That lets you use the Component Inspector to assign a video to play, configure options about its size and also assign a skin to it that will come with different types, colors and placement of built in buttons (play, pause, volume, seek bar with handle, mute, etc). The ForwardButton and BackButton aren't that sophisticated.


          If FLVPlayback with its built in skins aren't good enough for you, you're going to need to code those buttons to not only control the correct video but also to "do what you want" when pushed. It's essentially not much different than drawing your own custom button symbol and assigning a function to it to do the same thing. Which is to tell the video component to seek to the next or previous cuepoint.


          Here's an overview of cuepoints:


          http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d1 18a9c65586-7feb.html


          The relevant code example to look at which is what will help you seek to next and previous navigation cue points is this example:


          import fl.video.*; 
          // assume you have a FLVPlayback component on the stage with the 
          // instance name of my_FLVPlybk 
          my_FLVPlybk.addEventListener(VideoEvent.READY, ready_listener); 
          // example of seking to a specific cuepoint
          function ready_listener(eventObject:Object):void { 
          my_FLVPlybk.addEventListener(MetadataEvent.CUE_POINT, cp_listener); 
          function cp_listener(eventObject:MetadataEvent):void { 
              if(eventObject.info.time == 7.748) 
                  my_FLVPlybk.seekToPrevNavCuePoint(eventObject.info.time - .005); // seek to previous cue
                  my_FLVPlybk.seekToNextNavCuePoint(eventObject.info.time + 10); // seek to next cue
          my_FLVPlybk.source = "http://helpexamples.com/flash/video/cuepoints.flv";
          • 2. Re: Flash ForwardButton and BackButton Component Help Please
            fermp Level 1

            Hi Sinious,


            Thanks for the quick reply. I got a couple of errors when using the above code. I'll mess with it a bit. I am wondering if you've used any of the Flash skins, that normally don't need any programming. The skin the forward and back buttons don't seem to do anything. The play, mute, volume and all the other controls work, but if you hit forward or back nothing happens but a short hop one way or the other. You would think they would jump to the next cue. If I can figure out what the skin forward and back buttons would do I might not have to mess with the code.

            • 3. Re: Flash ForwardButton and BackButton Component Help Please
              sinious Most Valuable Participant

              The vast majority of the use of those buttons is to do just that, go forward or backwards a small bit of time. Like fast forward and rewind. You have a specialty desire which 99.9% of the usage of the prebuilt controls is never used for. You want to seek to cue points. So you need to customize what happens when you push those buttons for your special needs.


              To my knowledge, none of the premade components will do what you want and I'm pretty familiar with all of them. I tend to make my own though.


              The code above is not intended to give you all the code you need to do what you want. It's not my code, I just copy and pasted code from that link and added a couple comments. You need to read the information on that page. It's a tutorial on that exact code. I just posted to code so you know where to start reading to accomplish your goal.

              • 4. Re: Flash ForwardButton and BackButton Component Help Please
                fermp Level 1

                That's what I needed to know. Thanks.

                • 5. Re: Flash ForwardButton and BackButton Component Help Please
                  sinious Most Valuable Participant

                  You're welcome and good luck! If you have a specific question about the implementation of that or don't understand that tutorial just ask.