06年学类时,写的菜单效果。模仿苹果机中的菜单效果,鼠标经过图标时,以该图标为中心向两边缩放。 attachMc(scale);
resetPosition();
}
//加载图片
private function attachMc(scale:Number):Void {
for (var i:Number = 0; i
mouseControlZoomEffect(menu, scale);
menu.onRollOver = function() {
//trace(this._name);
};
}
}
//鼠标控制缩放比例效果
private function mouseControlZoomEffect(mc:MovieClip, scale:Number):Void {
var owner:Object = this;//用一个临时变量指向当前类
mc.onEnterFrame = function() {
var mouseX:Number = Math.abs(this._x+this._width/2+owner.imageContainer._x-owner.imageContainer._parent._xmouse);
//trace(mc._name+">>> "+mouseX);trace("");
if (owner.imageContainer.hitTest(owner.target._xmouse, owner.target._ymouse)) {
if (mouseX
owner.zoomEffect(this, num);
} else {
owner.zoomEffect(this, 100);
}
} else {
owner.zoomEffect(this, 100);
}
updateAfterEvent();
};
}
//缩放效果
private function zoomEffect(mc:MovieClip, scale:Number):Void {
var ratio:Number = .4;
mc._xscale = mc._yscale += (scale-mc._xscale)*ratio;
}
//重新设置各菜单的位置
private function resetPosition():Void {
var owner:Object = this;
target.onEnterFrame = function() {
for (var i:Number = 0; i
menu._x = owner.imageContainer["menu"+(i-1)]._x+owner.imageContainer["menu"+(i-1)]._width+owner.spanX;
menu._y = owner.ypos-menu._height;
owner.imageContainer._x = (Stage.width-owner.imageContainer._width)/2;
}
updateAfterEvent();
};
}
//转义(位置、间距等)
public function get _ypos():Number {
return this.ypos;
}
public function set _ypos(values:Number):Void {
this.ypos = values;
}
public function get _spanX():Number {
return this.spanX;
}
public function set _spanX(values:Number):Void {
this.spanX = values;
}
public function get _x():Number {
return this.target._x;
}
public function set _x(values:Number):Void {
this.target._x = values;
}
public function get _y():Number {
return this.target._y;
}
public function set _y(values:Number):Void {
this.target._y = values;
}
}
我最强舞者 (I, Best Dancer)安卓版v8
我最强舞者(I, Best Dancer)是一款休闲放置类手
迷你世界国服版本2024 v1.43.0
迷你世界国服版本2024是一款自由度非常高的沙盒游戏,玩法和
烹饪乐园 安卓版v1.23.6
烹饪乐园(Cooking Town)是一款非常好玩的餐厅模拟
迷你世界小米服 最新安卓版v1.43.0
迷你世界小米版是由迷你玩科技开发的休闲模拟经营类游戏。此版本
布娃娃Sprunki沙盒 安卓版v0.0.1
布娃娃Sprunki沙盒是一个非常有趣的沙盒游戏,复古简约的