View Full Version : Loop to detect display objects
nburlington
October 21st, 2008, 10:11 AM
How can I loop through a displayObject to detect children of a certain class? here is an example of what i would like to do
for each(var item:CustomDisplayItem in ParentDisplayObject){
trace("Hi, I'm a " + item);
}
unindexed
October 21st, 2008, 10:30 AM
numChildren is your answer.
creatify
October 21st, 2008, 12:30 PM
numChildren is your answer.see http://www.kirupa.com/forum/showthread.php?t=311358 for details
sekasi
October 21st, 2008, 04:35 PM
for (var i:int = 0; i < numChildren; i++)
{
trace("The object at index" +i+ "is an instance of" +getQualifiedClassName(getChildAt(i)));
}
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.