I think you also have to test if CurObj is IFocusManagerComponent.  See 
addFocusables in mx.managers.FocusManager.as

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
itdanny2002
Sent: Thursday, November 13, 2008 10:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: All Focus Components in Container


I use following function to get but not success.
Many IMAGES, INPUT button has been collected.
Of course, I can filter out but there are so many
controls. Any idea to modify the function ? I wanna
to get all tabbable components in a container.

public function GetTabChild(Mother:Container):Array{
function getTab(Mother:Container):void {
for ( var i:uint; i < Mother.numChildren ; i++ ) {
var CurObj:UIComponent = UIComponent(Mother.getChildAt(i));
if (CurObj is Container) {
if (CurObj.tabChildren) {
getTab(CurObj);
}
}
else if (CurObj.visible &&
CurObj.enabled &&
CurObj.focusEnabled &&
CurObj.tabEnabled) {
objs.push(CurObj);}}
}
var objs:Array = new Array;
getTab(Mother);
return objs;

Reply via email to