主题:  这个this

fgnn

职务:普通成员
等级:1
金币:1.0
发贴:215
#12002/6/1 15:00:06
下面这段脚本是写在一个空白祯内的:// create first node to initiate recursive self-construction
newnode="mothernode";
this.attachMovie("node",newnode,1);
// cx, cy determines the structure's center point
var cx=300;
var cy=175;
this[newnode]._x=cx;
this[newnode]._y=cy;
// modify the structure's overall size
this[newnode]._xscale=50;
this[newnode]._yscale=50;
// depth gets increment with each new instantiation
this[newnode].depth=1;
这里的this是指什么?



手工感情

职务:普通成员
等级:3
金币:10.0
发贴:556
#22002/6/1 23:20:17
是写在场景内第一帧么?那么this就是指的_root.


黑色的风略过我的翅膀,我却无法落下来梳理你的羽毛
————————————————
◆5d.cn互动论坛◆
------|xml版主|------

wukun

职务:普通成员
等级:1
金币:1.0
发贴:222
#32002/6/2 0:58:15
handmade,为什么楼上那位的代码有点奇怪,只attach了一个movie还要写那么多,一看还以为是XML,有特殊用途吗?



realbobo

职务:普通成员
等级:1
金币:1.0
发贴:180
#42002/6/2 11:12:39
这种格式通常用做复制影片的。this就是指当前路径嘛。



手工感情

职务:普通成员
等级:3
金币:10.0
发贴:556
#52002/6/3 3:15:32
没有什么特殊的用途,attach一个mc后instance命名为"mothernode",设置坐标值和缩放,以及depth。


黑色的风略过我的翅膀,我却无法落下来梳理你的羽毛
————————————————
◆5d.cn互动论坛◆
------|xml版主|------

Mozier

职务:管理员
等级:5
金币:11.0
发贴:2994
#62002/6/3 9:24:34
this写在mc里就指当前mc,写在场景就指当前场景。。



fgnn

职务:普通成员
等级:1
金币:1.0
发贴:215
#72002/6/3 15:09:15
谢了