Last active
October 9, 2019 09:25
-
-
Save harpwood/01889108c3bfd9b57e7ac2cc6ddff5fd to your computer and use it in GitHub Desktop.
Simple function that removes from stage and "kills"(nullify) any given movieclip.
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
private function kill(childObj:String, parentObj:String = ""):void | |
{ | |
if (this[childObj] != null) | |
{ | |
if (stage.contains(this[childObj])) | |
{ | |
if (parentObj != "") this[parentObj].removeChild(this[childObj]); | |
else removeChild(this[childObj]); | |
} | |
this[childObj] = null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment