0
A
回答
1
比方说,我们有一个影片剪辑 'MCA' MCA包含其他3部影片剪辑'MCB','MCC','麦当劳'。现在 ,我们可以说泰德MCB,MCC和MCD是孩子的MCA 所以如果我们想知道有多少孩子的一个影片剪辑有,我们可以使用movieclip.numChildren。 在我们的例子中,我们有:
mcA.numChildren -> this is equals to 3
trace(mcA.numChildren); //output 3
trace(mcB.numChildren); //output 0
getChildAt是一个参数,表示孩子的索引/层梅托德/功能。 如果图层存在,此方法将返回该索引处的子项。
例如:
mcA :
index0- mcC
index1 - mcD
index2 - mcB
,如果这是MCA然后的结构:
mcA.getChildAt(0); //this will return mcC
mcA.getChildAt(1); //this will return mcD
mcA.getChildAt(2); //this will return mcB
mcA.getChildAt(3); //this is error 'The supplied index is out of bounds ...'
相关问题
- 1. as3 flash getChildAt(0).some方法访问
- 2. LinearLayout EditText和getChildAt
- 3. 试图取消使用getChildAt()
- 4. getChildAt用的addChild
- 5. .numChildren()总是返回0
- 6. 在Flash中使用帧和函数AS3
- 7. 在TextFlow AS3中使用VerticalAlignment和InlineGraphicElement Flex
- 8. getChildAt的Nullpointerexception
- 9. Android LinearLayout getChildAt(index)
- 10. getChildAt(POS)上RecyclerView
- 11. listview getChildAt()返回null
- 12. Android焦点与getChildAt
- 13. 使用数组和hitTest - AS3
- 14. 在iPhone和Android使用as3通知
- 15. getChildAt始终返回null
- 16. Custom ListView view = getChildAt(0)throw NullPointerException
- 17. 列表视图getChildAt()为null
- 18. Gridview getChildAt隐藏字段
- 19. 的Android LinearLayoutManager#getChildAt(INT)retuns空
- 20. RecyclerView getChildAt(position)返回null
- 21. viewpager中的getchildat无法正常工作
- 22. 有没有办法监听flash.display.DisplayObjectContainer numChildren属性中的更改?
- 23. 在Flash CS4 AS3中使用localToGlobal
- 24. as3在其他类中使用setter(父)
- 25. AS3:在库对象中使用beginBitmapFill()
- 26. 在AS3中使用键盘事件
- 27. 在AS3中使用Excel文件
- 28. 如何在AS3中使用droptarget?
- 29. 如何在as3中使用stage.addEventListener?
- 30. 在flex中使用地理位置,AS3