level 5
似曾相识ぺ
楼主
在一个函数中调用另一个函数的阵列,不能被定义,这是怎么回事啊。比如下面写的这个:
var a = new Array();
ren.onEnterFrame = function() {
if (Key.isDown(Key.SPACE)) {
a[4] = 10;
shoot();
}
};
i = 0;
function shoot() {
if (i<10) {
btls = _root.attachMovie("aa", "aa"+i, i);
btls._x = ren._x;
btls._y = ren._y;
btls.onEnterFrame = function() {
this._y += a[4];
};
}
}
为什么this._y+=a[4]中的a[4]没被附值呢
2012年08月11日 04点08分
1
var a = new Array();
ren.onEnterFrame = function() {
if (Key.isDown(Key.SPACE)) {
a[4] = 10;
shoot();
}
};
i = 0;
function shoot() {
if (i<10) {
btls = _root.attachMovie("aa", "aa"+i, i);
btls._x = ren._x;
btls._y = ren._y;
btls.onEnterFrame = function() {
this._y += a[4];
};
}
}
为什么this._y+=a[4]中的a[4]没被附值呢