Created
August 11, 2015 03:40
-
-
Save bendmorris/5219affdd32efc08eedc to your computer and use it in GitHub Desktop.
Replace member in Graphiclist (HaxePunk)
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
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