1 Reply Latest reply on Apr 17, 2007 8:49 AM by Newsgroup_User

    Help Please

    rojere3
      yes i need help in the if then else coding in flash

      i have 3 buttons.

      when i click on each button i want to designate a variable for that button.

      each button will load a certain movie clip
      btn1_txt_mc for i made a text element inside a movie clip that i want displayed.

      btn2_txt_mc
      btn3_txt_mc

      button 1 = gave instance name btn1_mc
      need to set variable to btn1

      button 2 = gave instance name btn2_mc
      need to set variable to btn2

      button 3 = gave instance name btn3_mc
      need to set variable to btn3



      then in actionscript i want to toggle those conditions.

      if variable = btn1
      then
      display btn1_txt_mc - movie clip
      else
      if variable = btn2
      then
      display btn2_txt_mc - movie clip
      else
      if variable = btn3
      then
      display btn3_txt_mc - movie clip
      else
      display nothing
      end if

      but in actionscript im not sure how to implement any of that.
      can anyone help?
        • 1. Re: Help Please
          Level 7
          Do something like this.

          //Put all the movieclips on the stage. Then set the visibility to false.

          myMC1._visible = false
          myMC2._visible = false
          myMC3._visible = false

          //then just make them visible when the buttons are clicked.

          btn1_mc.onRelease = function(){
          myMC1._visible = true;
          myMC2._visible = false ; //set the others to false if you want
          myMC3._visible = false;
          }

          btn2_mc.onRelease = function(){
          myMC1._visible = false;
          myMC2._visible = true;
          myMC3._visible = false;
          }


          --

          Dan Mode
          --> Adobe Community Expert
          *Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
          *THE online Radio* http://www.tornadostream.com <--check this

          *Must Read* http://www.smithmediafusion.com/blog


          "rojere3" <webforumsuser@macromedia.com> wrote in message
          news:evviug$cr6$1@forums.macromedia.com...
          > yes i need help in the if then else coding in flash
          >
          > i have 3 buttons.
          >
          > when i click on each button i want to designate a variable for that
          > button.
          >
          > each button will load a certain movie clip
          > btn1_txt_mc for i made a text element inside a movie clip that i want
          > displayed.
          >
          > btn2_txt_mc
          > btn3_txt_mc
          >
          > button 1 = gave instance name btn1_mc
          > need to set variable to btn1
          >
          > button 2 = gave instance name btn2_mc
          > need to set variable to btn2
          >
          > button 3 = gave instance name btn3_mc
          > need to set variable to btn3
          >
          >
          >
          > then in actionscript i want to toggle those conditions.
          >
          > if variable = btn1
          > then
          > display btn1_txt_mc - movie clip
          > else
          > if variable = btn2
          > then
          > display btn2_txt_mc - movie clip
          > else
          > if variable = btn3
          > then
          > display btn3_txt_mc - movie clip
          > else
          > display nothing
          > end if
          >
          > but in actionscript im not sure how to implement any of that.
          > can anyone help?
          >