Search code examples
javascripteaseljsstage

how to get stage children using id easeljs


Hello I am new to EaselJS library. I have been trying to get three objects and lines linking three objects. I have tried to get the objects using indices but the indices change every time one of the object gets deleted, but the id's of the objects remain constant even after another object has been deleted. Can we some how get a particular object based on id rather than the index mentioned in the easeljs library getChildAt ( index ).


Solution

  • After searching for a while, I found a another way to achieve the same. Whenever you create the variable assign the id to the name. This way you can use the getChildByName(String) to retrive the object given the name is saved.