Created
June 10, 2011 17:54
-
-
Save rafaelrinaldi/1019360 to your computer and use it in GitHub Desktop.
Return an Array with the children of any container.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tea.display | |
{ | |
import flash.display.DisplayObject; | |
import flash.display.DisplayObjectContainer; | |
/** | |
* | |
* Return an <code>Array</code> with the children of any container. | |
* | |
* @param p_target The container you want. | |
* | |
* @author Rafael Rinaldi (rafaelrinaldi.com) | |
* @since May 25, 2011 | |
* | |
*/ | |
public function getChildren( p_target : DisplayObjectContainer ) : Array { | |
var children : Array = []; | |
for(var count : int = 0, child : DisplayObject; count < p_target.numChildren; count++) { | |
child = p_target.getChildAt(count); | |
if(child != null) children.push(child); | |
} | |
return children; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment