Use the 'is' operator:
 
    if (field is ValidatedTextInput)
 
Gordon Smith
Adobe Flex SDK Team

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of aceoohay
Sent: Friday, February 15, 2008 11:31 PM
To: [email protected]
Subject: [flexcoders] Finding objects in flex



I want to loop through all of the children of a flex object and find 
all children of a specific type.

I have code that works, but it looks really kludgy;

for each (var field:Object in object.getChildren())
{
if (field.constructor.toString() == "[class ValidatedTextInput]")
{
field.validateData();
if (bolAllValid ) bolAllValid = field.isValid;
}
}

Like I said it works, but there has got to be something better than;

if (field.constructor.toString() == "[class ValidatedTextInput]")

All help is rewarded with an attaboy!

Actually it is greatly appreciated, but it is getting late.

Paul



 

Reply via email to