Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-30-2009, 02:44 PM   PM User | #1
wac
Regular Coder

 
wac's Avatar
 
Join Date: Sep 2002
Location: Cary, North Carolina, USA
Posts: 359
Thanks: 2
Thanked 0 Times in 0 Posts
wac is an unknown quantity at this point
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
wac is offline   Reply With Quote
Old 07-31-2009, 12:32 AM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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:
Code:
<mx:Script>
	<![CDATA[
	private function setEnabled(enabled:Boolean):void
	{
		// your logic
		customComponentName.enabled = enabled;
	}
	]]>
</mx:Script>
<mx:Button label="Disable" click="setEnabled(false)" />
<mx:Button label="Enable" click="setEnabled(true)" />
That is not tested -- it's just for example purposes.
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:36 PM.


Advertisement
Log in to turn off these ads.