三个影片分别取实例名称:mc1 mc2 mc3
var step:Number = 5;
for (var i:Number = 1; i<=3; i++) {
var t:MovieClip = this["mc"+i];
t._alpha = 0;
t.onRollOver = function() {
this.onEnterFrame = function() {
this._alpha += step;
if (this._alpha>100) {
this._alpha = 100;
delete this.onEnterFrame;
}
};
};
t.onRollOut = t.onReleaseOutside=function () {
this.onEnterFrame = function() {
this._alpha -= step;
if (this._alpha<0) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
};
}
把代码复制到时间轴第一帧就行了