10 Replies Latest reply on Nov 22, 2010 3:34 AM by razrez

    How to disable buttons under an FLV?

    razrez

      Hello,


      I have designed a website in Flash AS2 and it is nearly complete, but I have one big problem. On my main page, I have a line of scrolling buttons as well as a slide show which also doubles up as a button. All of these buttons link to FLV movies. When clicked, the movie page fades up to cover the entire stage.

       

      This is the effect I want and I like the way it looks, but the problem is, all the buttons remain active underneath the FLV as it plays. So if you accidentally click on the movie while its playing, it's still possible to trigger one of these buttons, causing all kinds of undesired chaos!

       

      Here is a link to the current swf, so you can see exactly what I'm talking about.

      http://www.razrez.co.uk/FlashUpdateTest.html

       

      The row of scrolling buttons (the circles) and the arrow buttons at the bottom are contained within a single movie.

       

      I must point out that I am not well versed in action script. I have picked up bits and pieces as I've gone along but I don't speak the language, so I would really appreciate it if somebody could walk me through this step by step.

       

      Thank you very much for your time.

       

      Martin

        • 1. Re: How to disable buttons under an FLV?
          kglad Adobe Community Professional & MVP

          you can use the _visible property or the enabled property to enable/disable buttons/movieclips.

          • 2. Re: How to disable buttons under an FLV?
            razrez Level 1

            I've heard that mentioned before, kglad, but would you mind explaining? As I mentioned, I'm not action script savvy.

            Perhaps you could give me an idea of how to do that (in relation to the link I gave above).

             

            Thanks

            • 3. Re: How to disable buttons under an FLV?
              kglad Adobe Community Professional & MVP

              whatever objects you want to disable you can assign their enabled property to false:

               

              button1.enabled=false;

               

              movieclip1.enabled=false;

              • 4. Re: How to disable buttons under an FLV?
                razrez Level 1

                Thanks for the clue, but you left out a bit of vital info! It seems you need this line to make it work:

                 

                button1.onRelease = function(){

                 

                I found the answer eventually by scouring the internet. I think mentiomed that I'm not clued up on action script. Sorry, but I need a bit more guidance than one line of code. I just want to get this thing done without having to piece puzzles together

                 

                This worked on one page, where the movie clip I'm using as a button is on the top layer (or the "Parent"?). But if you could look at that link again, the main page has a row of buttons along the bottom which are contained within a movie that scrolls.

                 

                http://www.razrez.co.uk/FlashUpdateTest.html

                 

                I can't get any of these buttons to disable. Nothing seems to work and I'm wondering if it's something to do with the fact that these buttons are all contained inside this one movie (called BTNstrip)?

                 

                I've tried this:

                 

                TJF_BTN.onRelease = function(){
                     TJF_BTN.enabled = false;

                 

                and this:

                 

                BTNstrip.onRelease = function(){
                    TJF_BTN.enabled = false;

                 

                and I've tried this:

                 

                this.BTNstrip.TJF_BTN. = function(){
                    this.BTNstrip.TJF_BTN.enabled = false;

                 

                Nothing!!

                 

                I'd be very grateful if you could have a look and give me your thoughts. It's driving me nuts!!

                 

                Thanks

                • 5. Re: How to disable buttons under an FLV?
                  gaminflash

                  also try:

                   

                  TJF_BTN._visible = false;

                   

                  or

                   

                  BTNstrip._visible = false;

                   

                  Your button or movieclip will be invisible when doing this command and because of that you can make a "graphic" with the same look as the button or movieclip at the exactly the same place so it looks like the button has been disabled.

                  • 6. Re: How to disable buttons under an FLV?
                    razrez Level 1

                    Thanks gaminflash!

                     

                    I did try something like that already without much luck, but I'll give it another go and let you know how I get on.

                    • 7. Re: How to disable buttons under an FLV?
                      Ned Murphy Adobe Community Professional & MVP

                      It never hurts to check... Are you assigning instance names to these buttons and using those names (right way), or are you just using their library names (wrong way)?

                      • 8. Re: How to disable buttons under an FLV?
                        razrez Level 1

                        Hi Ned,

                        Yes I'm definitely using the instance names, but I've made that mistake before so thanks for checking

                         

                        Have you any other ideas what could be causing the problem?

                         

                        If you have a look on the "Hello" page, click on the TV and run the mouse over the FLV when it plays, you'll see I disabled the buttons successfully there, and when you close the FLV window, I've enabled them again.

                         

                        Can't seem to pull the same trick with the home page though - I think that movie containing the buttons must be causing a conflict or something??

                         

                        Any ideas, let me know! Thanks.

                        • 9. Re: How to disable buttons under an FLV?
                          Ned Murphy Adobe Community Professional & MVP

                          Generally, it will be a matter of proper targeting, so how you target the buttons depends on where they reside relative to where you are placing the code to enable/disable them.  And if neither of the two approaches work, _visible/enabled, then I would suspect the targeting is the issue.  And targeting involves making sure you follow the instance path from the timeline you're in to the object, using properly assigned and spelled instance names across the board.

                           

                          And you probably already know that, so it isn't much help, but I suspect you are missing the targets in a similar manner for any buttons that don't get disabled when you expect them to.

                          1 person found this helpful
                          • 10. Re: How to disable buttons under an FLV?
                            razrez Level 1

                            Thanks Ned - it's actually very helpful to have it spelt out like that. I don't know a hell of a lot about action script and have been learning as I go along.

                             

                            I will bear that in mind and trace it all through again. If I get stuck, you'll no doubt see me again!