放大图片缩小图片出现闪动
并排的8个小图,对每一个小图定义事件如下:
onRollOver时,放大图片,放大20%,scale+20,X,Y都是。放大后希望整个图片保持原来的中心点不动。(如何能精确控制在中心点不动的地方也是个问题,现在我只是大约的用眼睛看的。)
onRollOut时,图片变小,变回原来的大小,
放大缩小都实现了,最上面的深度经先进们指导,也实现了,
新的问题是:
当鼠标放在小图边框,边缘不动时,图片会放大一下,但没放大到最大,只是放大了一点,然后又迅速的缩小,然后又再次变大,再次变小,
就形成大小大小,不停的闪动。
不知是什么原因。
希望有经验的先进再帮我一下。
谁能接近模拟http://lexus.jp/下面的小图变大
http://lexus.jp/
这页中FLASH的下面的小图变大,
变大和变小时不会闪动。
都是平缓的。
我自己做的,怎么也不能完全不闪动。
是不是缓动函数出了问题呢?>
==================================
我现在的代码主要是:
eval("button"+count).onRollOver = function() {
_root.topDepth+=1;
this.swapDepths(_root.topDepth);//set the button icon to the top Depths
/*modified by yiliu*/
//the moto is a class writen by me,there are some other methods in the file:
//"com_zszen\spirit\moto.as"
//you can change the method which you like;
this._xscale+=20;
this._yscale+=20;
//moto.perTo(this, "_xscale", this.ow+20);
//moto.perTo(this, "_yscale", this.oh+20);
//moto.perTo(this, "_x", this.ox-13);
moto.perTo(this, "_x", this.ox-_root.buttonDescX);
moto.perTo(this, "_y", this.oy-_root.buttonDescY);
//moto.perTo(this, "_y", this.oy-10/2);
//trace(_root.buttonDescX);
moto.perTo(this.bg, "_alpha", 100);//set button's background alpha as 100 to show a clear image
var glow:GlowFilter = new GlowFilter(buttonGlow, 1, 8, 3, 2, 3);//glow
//glow.blurX = 80;
//glow.blurY = 80;
this.filters = [glow];//end glow
/*modified by yiliu*/
}//end onRollOver
==========================
x_,_y,_xscale,_yscale
这4个变化是最核心的。