Skip to content

Instantly share code, notes, and snippets.

@harpwood
Last active October 9, 2019 09:25
Show Gist options
  • Save harpwood/01889108c3bfd9b57e7ac2cc6ddff5fd to your computer and use it in GitHub Desktop.
Save harpwood/01889108c3bfd9b57e7ac2cc6ddff5fd to your computer and use it in GitHub Desktop.
Simple function that removes from stage and "kills"(nullify) any given movieclip.
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