Determine if a display object is a component that can use method validateNow()
I'm trying to cycle through everyone of my display objects to find out if it's a component that I can use .validateNow() on. I found code that cycles through all the display objects on my stage, but I have no idea how to tell if the display object is a ui component that has the validateNow() method. My problem comes from when I resize my flash application, components don't render correctly. I can use validateNow on each individual component, but there has to be a way to get all of them quickly. Like if(dsoChild is uicomponent) then dsoChild.validateNow() .
getChildren(this);
function getChildren(dsObject:DisplayObjectContainer, iDepth:int = 0):void
{
var i:int = 0;
var sDummyTabs:String = "";
var dsoChild:DisplayObject;
for (i ; i < iDepth ; i++)
sDummyTabs += "\t";
trace(sDummyTabs + dsObject);
for (i = 0; i < dsObject.numChildren ; ++i)
{
dsoChild = dsObject.getChildAt(i);
if (dsoChild is DisplayObjectContainer && 0 < DisplayObjectContainer(dsoChild).numChildren) {
getChildren(dsoChild as DisplayObjectContainer,++iDepth);
}
else {
trace(sDummyTabs + "\t" + dsoChild);
}
}
}
