2 Replies Latest reply on May 30, 2007 5:24 AM by nITiNkIlLeRmEeRuT

    Need help with actionscript else if

    Marko20
      I need my script to say when the swf starts to play to have all movie clips at alpha 0% and when a button is pushed to make the movie clips alpha 100%. I have to use the timeline on scene1 to do eveything, I have a new movieclips [popping up every 90 frames, the movieclips are actually captions so every 90 frames a caption changes, well theres 2 buttons one to bring up the movie clip the other to bring it down. I need everything in scene1 because if you rewing the video it will rewing the captions with the scenes. So I figiure the actionscript woul be something like cap1 cap2 cap 3 cap 4 cap 5 cap 6 on start = alpha 0 if button up press cap1 cap2 cap3 cap4 cap5 cap6 aplpha = 100% in button down cap1 cap 2 cap3 cap4 cap5 cap6 = 0%. I hope this makes sense thank you for reading.
        • 1. Re: Need help with actionscript else if
          Devdoc Level 1
          Ok then! Let's say we have 3 clips named cap1, 2 and 3.
          If they are already on the stage and have instance names we just access the apha property of the clips:

          _root.cap1._alpha = 0;
          _root.cap2._alpha = 0;
          _root.cap3._alpha = 0;

          _root is a reference to the main timline of the movie. Too keep it simple, create two buttons and place them on the stage. Give them instance names (i'll call them btn_show and btn_hide). We are assigning functions to the onRelease event, when someone releases the button after pressing on it.

          _root.btn_show.onRelease = function(){
          _root.cap1._alpha = 100;
          _root.cap2._alpha = 100;
          _root.cap3._alpha = 100;
          }
          _root.btn_hide.onRelease = function(){
          _root.cap1._alpha = 0;
          _root.cap2._alpha = 0;
          _root.cap3._alpha = 0;
          }

          I think you get it by now ;-)
          • 2. Re: Need help with actionscript else if
            nITiNkIlLeRmEeRuT Level 1
            or may be this way