Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder wac's Avatar
    Join Date
    Sep 2002
    Cary, North Carolina, USA
    Thanked 0 Times in 0 Posts

    enabled/disabled event

    Is there any event that occurs when a component is enabled or disabled? I've got to integrate with a custom component whose source I don't control and would like to determine when the user has done something that causes a subcomponent to be enabled or disabled. I can find the subcomponent by searching through the container hierarchy and add a listener to it, but I can't seem to be able to determine an event for enable/disable
    Wayne Christian

  2. #2
    Senior Coder Inigoesdr's Avatar
    Join Date
    Mar 2007
    Florida, USA
    Thanked 406 Times in 398 Posts
    There is no event that I know of that will fire when the enabled attribute is changed. Your best course of action would likely be to override the setter function for the component that updates the enabled property, and fire off a custom event. Or, if you control the part of the component that is taking action(a button for instance) you can use a wrapper function to do your event functionality, and then update the component. For example:
    	private function setEnabled(enabled:Boolean):void
    		// your logic
    		customComponentName.enabled = enabled;
    <mx:Button label="Disable" click="setEnabled(false)" />
    <mx:Button label="Enable" click="setEnabled(true)" />
    That is not tested -- it's just for example purposes.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts