回复:id与name有什么区别?用addChild加入的对象怎么取id呢?
乱啦~乱啦~
id,name,uid根本是3个概念啊。虽然都可以把它看成是【唯一】的东西...
id-
ID of the component.
Each component throughout an application should have a unique id.(UIComponent)
这代表了它真的是唯一了,唯一到编译器肯定会报错。
name-
Indicates the instance name of the DisplayObject.(DisplayObject)
这个东西主要用在父类通过name属性取得一个DisplayObject的方法上,getChildByName()。
uid-
A unique identifier for the object.(UIComponent)
uid它一共有32位,其中通过 ActionScript Math.random()来产生24位,
后面的8位是current date-time来决定的,虽然创造性决定了它是唯一的,
但是在实际编写代码的过程中,你可能会创造出2个object,但是uid是相同的。
具体内容请看这篇:
http://www.riachina.com/showtopic.aspx?topicid=6097