3 Replies Latest reply on Dec 20, 2007 5:09 PM by Newsgroup_User

    Button disable click event

    Zinzendorf
      Anyone know of a way to disable the click event for mx:button and keep the button active for a rollOver event? I created a button that, i don't want to be able to click, but still be able to roll over to carry out a function.
        • 1. Re: Button disable click event
          Garyl Woolworth Level 1
          There's two ways you can do this depending on how you want the button to interact. First is that you can set the enabled property of the button to false, the click will no longer register however events like mouseOver will.

          <mx:Button x="10" y="10" label="Testy Button" enabled="false" click="mx.controls.Alert.show('Clicked')" mouseOver="mx.controls.Alert.show('Rolled Over')"/>

          Take the mouseOver property off and you'll see what I mean. The thing with enabled is it changes the skin of the button to be greyed out to make it look like you can't click on this anymore. You could pretty easily swap the skin of the button for the enabled state back to the original button state however you still loose the interactivity of the button when you mouse over and it changes skin based on over, down, up which leads me to the second part of if you want that mouse interactivity why don't you just remove the click handler on the button then? So I think before this question can truly be answered, what more exactly is it that you want to do with this button, does the user still get the UI effects of the button just the click handler doesn't fire or what?
          • 2. Re: Button disable click event
            Zinzendorf Level 1
            TY, Kaotic101 for replying, i would still like the UIeffects to still be active. I would like the button click event to not even register. I am creating menus with buttons from rollOver events, but to do this i created a bunch of conditions to have it work the way that i want. The only thing i have to get around is when the user clicks on the button it pretty much messes everything up. If it would help to go into more detail i will. Thanks for people's time that respond to this topic!
            • 3. Re: Button disable click event
              Level 7
              TY, Kaotic101 for replying, i would still like the UIeffects to still be
              active. I would like the button click event to not even register. I am
              creating menus with buttons from rollOver events, but to do this i created a
              bunch of conditions to have it work the way that i want. The only thing i have
              to get around is when the user clicks on the button it pretty much messes
              everything up. If it would help to go into more detail i will. Thanks for
              people's time that respond to this topic!