Hi,
I'm trying to disable a button on a buttonbar but I'm getting an
error... here's what I have:
<mx:ButtonBar id="controlBar" height="20" width="100%"
horizontalGap="0" itemClick="buttonBarClickHandler(event);">
<mx:dataProvider>
<mx:Array>
<mx:String>New Topic</mx:String>
<mx:String>Reply</mx:String>
<mx:String>Edit</mx:String>
<mx:String>Delete</mx:String>
<mx:String>Save</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ButtonBar>
Then I have this:
import mx.controls.Button;
private function setAccess( accessLevel:String ):void {
switch(accessLevel) {
case "core":
Button(controlBar.getChildAt(1)).enabled = false;
break;
default:
trace("Error setting button states: Out of range");
}
}
The error I'm getting is:
"Call to a possibly undefined method getChildAt through a reference
with static type mx.core:IUIcomponent."
Does anyone know why I'm getting this error - and how I can resolve it
please ?!
Thanks,
Jamie.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/