清风明月

类别



友情链接

回复更新

计数器

日历

_root与movieclip的联系

Author: PublishTime:2006-2-8

在level0下实验
trace(typeof(_root))

out: movieclip
trace(_root instanceof MovieClip)
out:true
trace(_root.__proto__==MovieClip.prototype)
奇怪 out:false

而在任意一个instance中则out: true
说明在现在的版本里_root的原形链并不指向prototype

trace(_root.__proto__==Object.prototype)
out:true


看来在flash7以上版本中_root是一个特殊的实体

再看以下例子:
var a=new String()
trace(a.__constuctor__=String)
out : true
var b=new MovieClip()
trace(b.__constuctor__==MovieClip)
out :true

建立影片剪辑:
在其中 trace(this.__constructor__==MovieClip)

out:false
而输出 trace(this.constructor==MovieClip)

out :true

MovieClip真是奇怪的类,实例化和用代码建立不一样

分类于:flash

Comments

{CommentAuthor} at {CommentTime} | {CommentEmail} {CommentUrl} {CommentIp}
{CommentContent}
Powered by 5DBlog.com