7 Replies Latest reply on Nov 8, 2007 10:46 PM by kglad

    Button Visibility

    romeogq Level 1
      I have the following action pinned to my first frame. Why does the button (volume_btn) still show when playing the movie?

      volume_btn._visible = false;

      I simply want to have a toggling mute and volume button in my movie. The following 3rd and 4th lines also do not work. Why?

      on (release) {
      stopAllSounds();
      mute_btn._visible = false;
      volume_btn._visible = true;
      }
        • 1. Re: Button Visibility
          kglad Adobe Community Professional & MVP
          1. because your button's path/name isn't volume_btn or the path/name are correct but some code executes re-setting volume_btn's _visible property to true.

          2. same as 1.
          • 2. Button Visibility
            romeogq Level 1
            Thanks for the reply.

            'volume_btn' is the name of the instance, so I guess something must be reseting the button's visibility value to true.

            Here's what I have so far...
            - 3 Layers, 1Frame Each

            - (volume) layer contains 'volume_btn'

            - (mute) layer contains 'mute_btn'

            - (bg) layer contains actionscript:
            volume_btn._visible = false;'

            - 'mute_btn' contains actionscript:
            on (release) {
            stopAllSounds();
            mute_mov._visible = false;
            volume_mov._visible = true;
            }
            • 3. Re: Button Visibility
              kglad Adobe Community Professional & MVP
              is this a one frame swf? if yes, post a link to your fla

              if no, is there a stop() on the frame that contains the above? if yes, post a link to your fla

              if no, the volume_btn instance on the frame that contains your code is probably not the same instance as the one that you see.
              • 4. Re: Button Visibility
                romeogq Level 1
                I changed the _btn's to _mov's.

                .FLA File:
                http://www.sendspace.com/file/4hsaui
                • 5. Re: Button Visibility
                  kglad Adobe Community Professional & MVP
                  you don't have any instance name assigned to your volume_mov button. click on your button in the upper left of the stage, in the properties panel, below the object type dropdown is a textfield where you enter the instance name. type volume_mov there.
                  • 6. Button Visibility
                    romeogq Level 1
                    Cool! It works.

                    One last quick question... what function would be the opposite of 'stopAllSounds();'? So I can turn all the sound back on... or do I just have to replay the sound from the beginning?
                    • 7. Re: Button Visibility
                      kglad Adobe Community Professional & MVP
                      you don't have to play each sound from the beginning, but there is no global equivalent (of stopAllSounds() ) to restart all sounds. you need to use the position property of each sound and then start the sounds using the position property as an offset.