flash鼠标滑过 代码不管用,哪里错了呢?
onClipEvent(enterFrame){this.onRollOver=function(){this.onEnterFrame=function(){if(th...
onClipEvent(enterFrame){
this.onRollOver=function(){
this.onEnterFrame=function(){
if(this._xscale<110){
this._xscale=this.yscale+=2;
}
};
};
this.onRollOut=function(){
this.onEnterFrame=function(){
if(this._xscale>100){
this._xscale=this._yscale=100
}
};
};
}
我按enet教程写的,教程只有一半.第二个onRollOut后面的是我仿写的.测试时,鼠标滑过元件没有变大, 是第二段哪里没写对吗?还是都有问题? 展开
this.onRollOver=function(){
this.onEnterFrame=function(){
if(this._xscale<110){
this._xscale=this.yscale+=2;
}
};
};
this.onRollOut=function(){
this.onEnterFrame=function(){
if(this._xscale>100){
this._xscale=this._yscale=100
}
};
};
}
我按enet教程写的,教程只有一半.第二个onRollOut后面的是我仿写的.测试时,鼠标滑过元件没有变大, 是第二段哪里没写对吗?还是都有问题? 展开
1个回答
展开全部
第一段的yscale少了一个"_".
其实不须使用enterFrame来定义两个事件,用load更符合逻辑.
onClipEvent (load) {
this.onRollOver = function() {
this.onEnterFrame = function() {
if (this._xscale < 110) {
this._xscale = this._yscale += 2;
}
else {
delete this.onEnterFrame;
}
};
};
this.onRollOut = function() {
this.onEnterFrame = function() {
if (this._xscale > 100) {
this._xscale = this._yscale = 100;
delete this.onEnterFrame;
}
};
};
}
其实不须使用enterFrame来定义两个事件,用load更符合逻辑.
onClipEvent (load) {
this.onRollOver = function() {
this.onEnterFrame = function() {
if (this._xscale < 110) {
this._xscale = this._yscale += 2;
}
else {
delete this.onEnterFrame;
}
};
};
this.onRollOut = function() {
this.onEnterFrame = function() {
if (this._xscale > 100) {
this._xscale = this._yscale = 100;
delete this.onEnterFrame;
}
};
};
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询