FLASH里如何实现延时循环那?即运行完一个onEnterFrame在运行下一个onEnterFrame那?
this.mc._visible=false;for(i=0;i<10;i++){mc.duplicateMovieClip("mct"+i,10+i);varmct:M...
this.mc._visible = false;
for (i=0; i<10; i++) {
mc.duplicateMovieClip("mct"+i,10+i);
var mct:MovieClip = eval("mct"+i);
mct._x = 80*i;
if ((i%2) == 1) {
mct._y = 8;
} else {
mct._y = 0;
}
mct._alpha = 2;
mct.i=i
mct.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>100) {
delete (this.onEnterFrame);
}
};
}
FLASH里如何实现延时循环那?即运行完一个onEnterFrame在运行下一个onEnterFrame那?
代码如上:目的为当第一个mct渐显完毕后,下一个mct开始渐显,然后在下一个,再下一个。
现在做出来的是mct大家都一起渐显出来郁闷。谁能帮我改改代码那?写出来那? 展开
for (i=0; i<10; i++) {
mc.duplicateMovieClip("mct"+i,10+i);
var mct:MovieClip = eval("mct"+i);
mct._x = 80*i;
if ((i%2) == 1) {
mct._y = 8;
} else {
mct._y = 0;
}
mct._alpha = 2;
mct.i=i
mct.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>100) {
delete (this.onEnterFrame);
}
};
}
FLASH里如何实现延时循环那?即运行完一个onEnterFrame在运行下一个onEnterFrame那?
代码如上:目的为当第一个mct渐显完毕后,下一个mct开始渐显,然后在下一个,再下一个。
现在做出来的是mct大家都一起渐显出来郁闷。谁能帮我改改代码那?写出来那? 展开
展开全部
给一个影片命名为mc就可以了 把代码放到第一帧
this.mc._visible = false;
var i = 0;
var Num=10
//修改mc的个数就修改这个值就可以了
//=====================
copy(i);
function copy(i) {
mc.duplicateMovieClip("mct"+i, 10+i);
var mct:MovieClip = eval("mct"+i);
mct._x = 80*i;
if ((i%2) == 1) {
mct._y = 8;
} else {
mct._y = 0;
}
mct._alpha = 2;
alpha(mct, i);
}
//========================
function alpha(aa, i) {
onEnterFrame = function () {
aa._alpha += 2;
if (aa._alpha>=100) {
delete (onEnterFrame);
i++;
if (i<=Num) {
copy(i);
}
}
};
}
this.mc._visible = false;
var i = 0;
var Num=10
//修改mc的个数就修改这个值就可以了
//=====================
copy(i);
function copy(i) {
mc.duplicateMovieClip("mct"+i, 10+i);
var mct:MovieClip = eval("mct"+i);
mct._x = 80*i;
if ((i%2) == 1) {
mct._y = 8;
} else {
mct._y = 0;
}
mct._alpha = 2;
alpha(mct, i);
}
//========================
function alpha(aa, i) {
onEnterFrame = function () {
aa._alpha += 2;
if (aa._alpha>=100) {
delete (onEnterFrame);
i++;
if (i<=Num) {
copy(i);
}
}
};
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询