I try many ways to get all children in a cc.Layer In my Layer, i have 2 childrens. I using the following code to get all children and runAction FadeOut for all children in my Layer
for (var child in this._children){
child.runAction(
cc.FadeOut.create(interval)
);
}
In this above code. Type of this 'child' is cc.Node. But the value of this is 'index of' this chilren (ex, 0 or 1). So, when i execute 'runAction', i got an error: "Object 0 has no method 'runAction'"
In try to get child by tag as the following to compare 2 variable
var child0 = this.getChildByTag(0);
The result also cc.Node but value totally different from previous code. And i totally execute 'runAction' method with no error
So, how could i get ALL CHILDREN and receive each children like "getChildByTag" method.
Thanks in advance