Skip navigation
iden_tidad
Currently Being Moderated

Error while making button invisible :s

Aug 30, 2012 12:34 PM

Tags: #air #error #as3 #3.0 #button #action #3 #visible #actionscript #as3.0 #ac3 #invisible #actionscript3

Hi, I am trying to make some buttons invisible ONLY when it's on frame one!

I have this code:

 

function BtnVisible(evt:Event) :void {

if(currentFrame == 1) {

                    menu_btn.visible=false;

                    next_btn.visible=false;

                    back_btn.visible=false;

                    text_btn2.visible=false;

          } else (currentFrame > 1); {

                    menu_btn.visible=true;

                    next_btn.visible=true;

                    back_btn.visible=true;

          }

}

But the buttons are visible on frame one, if i delete the else code they get invisible, but in every frame :s

can someone tells me what wrong with my code ? :s

 
Replies
  • Currently Being Moderated
    Aug 30, 2012 12:56 PM   in reply to iden_tidad

    function BtnVisible(evt:Event) :void {

        if(currentFrame == 1) {

                            menu_btn.visible=false;

     

                            next_btn.visible=false;

     

                            back_btn.visible=false;

     

                            text_btn2.visible=false;

                  } else if(currentFrame > 1) {

                            menu_btn.visible=true;

                            next_btn.visible=true;

                            back_btn.visible=true;

                  }

        }

     

     

     

    OR

     

     

     

    function BtnVisible(evt:Event) :void {

        if(currentFrame == 1) {

                            menu_btn.visible=false;

     

                            next_btn.visible=false;

     

                            back_btn.visible=false;

     

                            text_btn2.visible=false;

                  } else {

                            menu_btn.visible=true;

                            next_btn.visible=true;

                            back_btn.visible=true;

                  }

        }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points