9 Replies Latest reply on Aug 12, 2009 4:31 PM by dalcde

    trouble turning animating buttons invisible

    drnen

      I have this set of buttons that i am using the _visible = false command on but they dont seem to be working. I have used this approach many times in the past and never had an issue- the only thing that is different about these buttons is that they are contained inside an animating movieclip, so im guessing that might be the problem. The movie clip animates around a small area of the stage, and the button contained within it has a simple rollover state that highlights the button area. The problem comes when i use loadmovienum to load another clip onto another level and the buttons hot spots still stay on the stage. The code im using on the actual buttons is something like :

       

      on(release){   
      loadMovieNum("print_index.swf",1);
      printbutton.visible = false;
      webbutton.visible = false;
      illusbutton.visible = false;
      threedbutton.visible = false;
      retouchbutton.visible = false;
      }

       

       

      And the movieclip that its contained within has no actionscript attached to it. If any of you have any thoughts it would be MUCH appreciated. Trying to put together a new web portfolio and this little problem is holding it up. The sample is up at www.darrenlasso.com/newindex.html and is still unfinished- but if you click on the PRINT button you can see what im talking about.

      thanks in advance!!!

        • 1. Re: trouble turning animating buttons invisible
          dalcde Level 1

          You should use _visible instead of visible, if you are using AS2 ( I don't know AS3 ). And try to use _root.printbutton instead of printbutton and also for the others.

          • 2. Re: trouble turning animating buttons invisible
            drnen Level 1

            hey thanks for the advice- still giving me odd results though. the root option isnt working at all, but i tried the _visible correction and the result was that the button that was actually being pressed disappeared as soon as it was clicked, but the other buttons stayed there under the surface of the 2nd level. Because the next level animates across the base movie with the buttons in it, if the button disappears right away on click then it just leaves a blank space for a second or 2 as the next level loads over top of it. Is there any way to leave the animation of the button there but to make the clickable area inactive? Currently using:

             

            on(release){   
            loadMovieNum("print_index.swf",1);
            printbutton._visible = false;
            webbutton._visible = false;
            illusbutton._visible = false;
            threedbutton._visible = false;
            retouchbutton._visible = false;
            }

             

            re-uploaded updated file to the same url if you want to see what i mean

            • 3. Re: trouble turning animating buttons invisible
              dalcde Level 1

              If the button itself is a button, not an MC, the mouse will always turn

              • 4. Re: trouble turning animating buttons invisible
                dalcde Level 1

                Sorry, pressed the wrong button.

                 

                onClipEvent (load) {
                    clickable = 1;
                }
                onClipEvent (enterFrame) {
                    onRelease = function () {
                        if (clickable == 1) {
                            clickable = 0;
                        }
                    };
                    _root.webbutton.onRelease = function() {
                        if (clickable == 1) {
                            //whatever you want it to do
                        }
                    };

                //etc.
                }

                • 5. Re: trouble turning animating buttons invisible
                  drnen Level 1

                  hmm tried it out.. assumedly i was supposed to attach that code to the movie clip that contained the button? I couldnt get it to work.. I'm just going to attach my file. I know its asking for a lot but I'm guessing if you are responding to this forum you appreciate a challenge So if you wouldnt mind taking a look at what i have and see if you can get it to work properly. Once its working for one button im sure i could get it to work for the others. Thanks a bazillion in advance!

                  • 6. Re: trouble turning animating buttons invisible
                    dalcde Level 1

                    Just put it on the print button, and the _root.webbutton.onRelease = function() part is for putting the code of the webbutton, so you don't have to add any code to the webbutton. If the webbutton ( and also the others ) has onEnterFrame or something similar, you can just use: _root.webbutton.onEnterFrame = function etc. Remember to put them into the onEnterFrame part. ( this print button has to be a MC )

                    • 7. Re: trouble turning animating buttons invisible
                      dalcde Level 1

                      I can't read the files, but if it still doesn't work, use _alpha = 0 instead of _visible = false

                      • 8. Re: trouble turning animating buttons invisible
                        drnen Level 1

                        Still not understanding your approach.. why would i define the web button inside the print button? And adding any of this code to the mc seems to negate the rollover action i had on the button.

                        I put a copy of the file @ http://www.darrenlasso.com/newindex.fla

                         

                        Let me know if you are able to take a look at it

                        • 9. Re: trouble turning animating buttons invisible
                          dalcde Level 1

                          Sorry, but I'm using Flash 8, which can't read it. If you don't want to define them in the print button, you can use this code on the other buttons:

                          on (release){ //or whatever

                               if(_root.printbutton.clickable == 1){

                                    //put the code inside

                               }

                          }