请教js 脚本的用法

我使用
cocos2d-x 的 JS 模板创建了项目 加入了自己生成的ccbi 我在ccbi里定义了层 层里定义了一些元素 加入到程序后 我想遍历层中的元素 在coco2d-x 中 只要 用

for(int i=0;igetChildrenCount();i++)

但是在
js中 laye.getChildrenCount()方法返回的是一个很大的值
layerhight是
var layer=cc.Layer.extend({
this.layerhight.getChildrenCount()
});

有没有用过getChildrenCount()方法的 朋友 或者也在学习JS 的朋友帮忙解决下3Q
147148615 我的QQ