3 Replies Latest reply on Nov 10, 2006 5:01 AM by Newsgroup_User

    how to "turn off" a button

    gringito
      Is there any way how to "TURN OFF" a button by AS? I mean keep the button _visible just make it not react like button (no on roll over, on press behaviour). In reality, I have semi transparent menu and there might be a case when there will be some stage buttons under my menu. I need keep the stage buttons visible but turn their function so the user would not be allowed to click them while the transparent menu covers them.

      Till now I always solved this situation by having two exactly same objects on each other - one button, on graphic and I was switching their _visible property depending if the button is supposed "to work" or not. That works fine but I have found it very "heavy", I search for "lighter" and more elegant solution.

      Thanks for any helps or recommendations.
        • 1. Re: how to "turn off" a button
          arunbe Level 1
          hi,

          there is a property for button in flash.

          If you want to deactivate the buttons without hiding, you can use this property.

          your_btn.enabled =false; //(or true)
          Instead of switching the visible , you try to use this one...

          Cool. :)

          Arun


          • 2. Re: how to "turn off" a button
            gringito Level 1
            oh yes, thats it. I need to study a lot :( thank you, Arun.
            • 3. Re: how to "turn off" a button
              Level 7
              gringito,

              >> there is a property for button in flash.
              >>
              >> If you want to deactivate the buttons without hiding,
              >> you can use this property.
              >>
              >> your_btn.enabled =false; //(or true)

              > oh yes, thats it. I need to study a lot :( thank you, Arun.

              Studying is good, for sure. But it's hardly *studying* to take a quick
              look at the Button class (or any class) in the ActionScript 2.0 Language
              Reference. ;) More like "looking something up in the dictionary," which
              thankfully isn't hard or time consuming. Remember, everything in
              ActionScript is an object, and objects are defined by classes. Classes
              feature properties (characteristics), methods (things the object can do),
              and events (things the object can react to), and may not feature something
              in all three categories.


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."