谁能翻译下面代码的意思,关于flash的

var chk = fals;
var myNum = 4;
for (i=1; i<8; i++){
this[ "icon" +i].
trgScale = 100;
this[ "icon" +i].
onRollOver=
function() { chk= true;
myNum = Number(this._name.substring(4));
};
this[ "icon" +i].onRollOut = function() {
chk = false;
reset();
};
}
var center = icon4._x;
function reset() {
for (i=1; i<8; i++){
this["icon"+i] .trgScale = 150;
}
myNum = 4;
icon4.onEnterFrame = function(){
var speed = (center-this._x)*0.4;
this._x +=speed;
if (Math.abs(speed)<0.1){
delete this.onEnterFrame;
}
};
}
this.onEnterFrame = function() {
for (i=1; i<8; i++) {
if (chk) {
var distance =Math.abs(this[ "icon" +i] ._x-this._xmouse)/2;
this[ "icon" +i] .trgScale= 200-distance;
if (this[ "icon" +i] .trgScale<100) {
this[ "icon" +i] .trgScale = 100;
}
}
this[ "icon" +i] ._xscale = this[ "icon" +i] ._yscale+= (this[ "icon" +i] .trgScale-this[ "icon" +i] ._xscale)*0.4;
}
for (i=myNum+1; i<8; i++){
this[ "icon" +i] ._x= this[ "icon" +(i-1)] ._x+this[ "icon" +(i-1)] ._width/2+this[ "icon" +i] ._width/2;
}
for (i=myNum-1; i>0; i--) {
this[ "icon" +i] ._x=this[ "icon" +(i+1)] ._x-this[ "icon" +(i+1)] ._width/2-this[ "icon" +i] ._width/2;
}
};

var chk = false;逻辑变量初值为否
var myNum = 4;变量4
for (i=1; i<8; i++){循环I初值为1,当小于8时执行后面的命令
this[ "icon" +i]. trgScale = 100; icon1-8的缩放
this[ "icon" +i]. onRollOver= function() { 当鼠标悬停在ICON1-8这几个按钮上时执行下面的命令;
chk= true;将CHK逻辑为是
myNum = Number(this._name.substring(4));
};
让myNUM的值变为当前文件名中的数字值。
this[ "icon" +i].onRollOut = function() {当鼠标移出ICON1-8这几个按钮上时执行下面的命令;

chk = false;逻辑否
reset();执行函数reset(后面定义的一个函数)
};
}
var center = icon4._x;便令CENTER为icon4的X坐标值
function reset() {定义一个函数reset,意为重置
for (i=1; i<8; i++){循环I初值为1,当小于8时执行后面的命令
this["icon"+i] .trgScale = 150;让ICON1-8缩放增大50%
}
myNum = 4;
icon4.onEnterFrame = function(){让icon4以帧频率不断执行下面的函数
var speed = (center-this._x)*0.4;
定义一个变量speed,指定值
this._x +=speed;当前文件的横坐标得到新的横坐标值,增加值为speed
if (Math.abs(speed)<0.1){当speed的绝对值小于0.1时执行
delete this.onEnterFrame;删除当前剪辑(以帧频率删除)
}
};
}
this.onEnterFrame = function() {
for (i=1; i<8; i++) {
if (chk) {
var distance =Math.abs(this[ "icon" +i] ._x-this._xmouse)/2;
this[ "icon" +i] .trgScale= 200-distance;
if (this[ "icon" +i] .trgScale<100) {
this[ "icon" +i] .trgScale = 100;
}
}
this[ "icon" +i] ._xscale = this[ "icon" +i] ._yscale+= (this[ "icon" +i] .trgScale-this[ "icon" +i] ._xscale)*0.4;
}
for (i=myNum+1; i<8; i++){
this[ "icon" +i] ._x= this[ "icon" +(i-1)] ._x+this[ "icon" +(i-1)] ._width/2+this[ "icon" +i] ._width/2;
}
for (i=myNum-1; i>0; i--) {
this[ "icon" +i] ._x=this[ "icon" +(i+1)] ._x-this[ "icon" +(i+1)] ._width/2-this[ "icon" +i] ._width/2;
}
};
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网