5 Replies Latest reply on Nov 29, 2009 5:06 AM by Ned Murphy

    Enable mc visible

    huray Level 1

      I have a button in the first frame. I have 1 movie clip in the second and third frame. Movie clips in second and third frame were made visible false.

      How do I enable the movie clip in the second frame and third frame visible by only clicking the button in the first frame when  go to play second frame and third frame ? Need help.

        • 1. Re: Enable mc visible
          kglad Adobe Community Professional & MVP

          if your button exists in the 2nd and third frame, you can assign your movieclip's visible (or _visible) property to true.

           

          if your button only exisits on the first frame, you could have your button assign a variable to true, if it's clicked.  then use that variable when your movieclips exist (in the 2nd frame) to assign their visible property to be that variable's value.

          • 2. Re: Enable mc visible
            huray Level 1

            How about showing a script on how to have the button assign a varible.

            • 3. Re: Enable mc visible
              Ned Murphy Adobe Community Professional & MVP

              To have the variable approach work you'd need to have an actions layer that extends across all the frames that involve these various objects.  In the first frame of that layer you would declare the variable.  In AS2 and AS3, the code for the variable you'd use could be the same... let's say you name it "showMC"... so in frame 1 of that actions layer...

               

              var showMC:Boolean;

               

              Then, in your button's event handler function you would set the value of showMC to be true...

               

              showMC = true;

               

              Hopefully you know how to code a button to work, but if not, indicate which version of actionscript you are using.

               

              Then, in frame 2 where the mc is, if the instance name of the movie is mcName, then you would have...

               

              if(showMC){

               

                   //use one or the other below, but not both

               

                   mcName._visible = true; // for AS2

                   mcName.visible = true; // for AS3

              }

               

              I would normally have that frame 2 code on a different actions layer that I use for individual frame code, keeping the one with the showMC variable unbroken by other keyframes.

              • 4. Re: Enable mc visible
                huray Level 1

                Done. Thanks

                • 5. Re: Enable mc visible
                  Ned Murphy Adobe Community Professional & MVP

                  You're welcome