Skip to content

Instantly share code, notes, and snippets.

@bendmorris
Created August 11, 2015 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bendmorris/5219affdd32efc08eedc to your computer and use it in GitHub Desktop.
Save bendmorris/5219affdd32efc08eedc to your computer and use it in GitHub Desktop.
Replace member in Graphiclist (HaxePunk)
function replace(graphicList:Graphiclist, search:Graphic, replace:Graphic) {
var children = graphicList.children;
var index = children.indexOf(search);
if (index > -1) {
children[index] = replace;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment