-
放一个比较不错的flash缓动函数上来
函数如下:
MovieClip.prototype.smoothMove = function(sp, tx,ty) {
if(tx!=0)
this._x = this._x+sp*(tx-this._x);//缓动
if(ty!=0)
this._y=this._y+sp*(ty-this._y);//缓动
};
MovieClip.prototype.MoveTo = function(sp, sx,sy) { //函数 中第一个参数是缓动系数(取值0--1之间),sx,sy 分别是目标点x,y坐标,当值为0时为在该方向不移动。
this.age = 0;
this.onEnterFrame = function() {
if (this.age<30) {
this.smoothMove(sp, sx,sy);
} else {
delete onEnterFrame;
}
this.age++;
};
};
调用的例子:
//水平缓动:
anyMovieClip.MoveTo(0.2, 200,0);
//垂直
anyMovieClip.MoveTo(0.2, 0,200);
//各个方向
anyMovieClip.MoveTo(0.2, 200,300);
-
相关阅读:
process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts
mac 查看ip
axios和vue-axios的关系
export default 和 export 区别
Mac 编辑hosts文件
npm --save-dev --save 的区别
CommonHelper 公共类
2.06StuModify.aspx(修改姓名,性别,所在班级)
linux网桥浅析
Bridge的数据在内核处理流程
-
原文地址:https://www.cnblogs.com/zhangsir/p/1128232.html
Copyright © 2020-2023
润新知