3 Replies Latest reply on Feb 1, 2013 12:59 AM by Rodan_Shiner

    Visibility button won't work correctly?

    Rodan_Shiner Level 1

      Hello. I am using Adobe Flash Pro CS6.

      Right now I am trying to make three buttons that show only one movie clip and hide other two movie clips.

      My layer structure is like this.

       

      Button (which has tree button instances)

      a_mc(wich has a 80 frames movie clip)

      b_mc(same as a_mc)

      c_mc(same as a_mc)

       

      And the script is like this.

       

      Button 1has this script.

       

      on(release)

      {

                _root.a_mc._visible = true;

                _root.b_mc._visible = false;

                _root.c_mc._visible = false;

                }

       

      Button 2 has this script.

      on(release)

      {

           _root.a_mc._visible = false;

           _root.b_mc._visible = true;

           _root.c_mc._visible = false;

           }

       

      Button 3 has this.

      on(release)

      {

           _root.a_mc._visible = false;

           _root.b_mc._visible = false;

           _root.c_mc._visible = true;

           }

       

      Three clips are 80 frames long, and I let them play all the time, but when I push  the Button2 or 3  to hide other 2 clips, it hides them, but when the playback time comes back to frame 1, the visibility setting is reset. For example, I push the Button 2 and hide a_mc and c_mc clips and show only the b_mc, but when the current time  comes back to 1 frame, visibility setting is reset and it shows a_mc and of course a_mc clip hides b_mc clip. Do you know why the visibility setting is reset? Please tell me what is the problem in my script.Thank you in advance.

        • 1. Re: Visibility button won't work correctly?
          Ned Murphy Adobe Community Professional & MVP

          I don't see where the code you show will be causing it.  Something is being reset and I suspect it has to do with whatever you mean regarding frame 1.  But I don't currently understand is what are you refering to when you say "the playback time comes back to frame 1"

           

          Which timeline is returning to frame 1, and what exists there both in terms of code and in terms of objects?

          1 person found this helpful
          • 2. Re: Visibility button won't work correctly?
            Rodan_Shiner Level 1

            Thank you for your reply. I am talking about this timeline..

            button.png

            The red 1 frame is the frame 1 I am talking about. a,b and c clips play till 80 frames. Those 3 clips are loop movies, so I want to let them loop, but I want to show only one clip using buttons, and hide other 2 clips, but that script setting is reset when a clip(,which the button sets to be solely shown) starts to play again.

            • 3. Re: Visibility button won't work correctly?
              Rodan_Shiner Level 1

              Sorry. It works. I imported 3 FLV files and threw them into individual layers, but I didn't change them into Movie clip symbol. So I changed all layers that has FLV movie clips into Movie clip symbol and previewed that. The visibility setting won't be ignored. I don't know why. I should not use raw video clips?