MovieClip.prototype.jump = function(scale, frequency, quotiety) {
//三个参数,scale–图片的比例 frequency—弹性的频率 quotiety—弹性系数
this.tempo += (scale – this._xscale) * frequency;
this.tempo *= quotiety;
this._xscale = this._yscale += this.tempo;
//令图片位于场景的中间(550X400)
this._x = 275-(this._width/2);
this._y = 200-(this._height/2);

};
//——–图片弹性效果的设置,这种效果你可以用在其它方面,比如按钮

//———–判断鼠标事件,当鼠标与图片碰撞时调用自定义的函数并赋值
mc.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.jump(70, .9, .6);
} else {
this.jumpl(30, .6, .5);
}
}


评论

该日志第一篇评论

发表评论

评论也有版权!