Created
March 25, 2011 06:56
-
-
Save rafaelrinaldi/886468 to your computer and use it in GitHub Desktop.
Simple way to avoid null childs inside a DisplayObjectContainer.
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 { | |
import flash.display.DisplayObject; | |
import flash.display.DisplayObjectContainer; | |
/** | |
* | |
* @author Rafael Rinaldi (rafaelrinaldi.com) | |
* @since 25/03/2011 | |
* | |
*/ | |
class SmartDisplayObjectContainer extends DisplayObjectContainer { | |
public function SmartDisplayObjectContainer() {} | |
/** badass **/ | |
override public function contains( p_child : DisplayObject ) : Boolean | |
{ | |
return p_child != null && super.contains(p_child); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment