暂存AS代码
来源:互联网 发布:opencv3编程入门 网盘 编辑:程序博客网 时间:2024/04/28 16:50
小角色让看看这些AS代码,暂存:
//场景宽度
var stag_x = Stage.width;
//场景高度
var Stag_y = Stage.height;
//自定义函数
function Dat(move, bot_D, bot_K, sped_x) {
//拖动。说明:其中的四个判断用于限制图片不得超出边框范围。
move.onPress = function() {
this.onEnterFrame = function() {
//向右拖的判断
if (this._x>=0) {
this._x = 0;
} else if (this._x<=(Stag_y-this._width)) {
//向左拖的判断
this._x = stag_x-this._width;
}
if (this._y>=0) {
//向下拖的判断
this._y = 0;
} else if (this._y<=Stag_y-this._height) {
//向上拖的判断
this._y = Stag_y-this._height;
}
};
this.startDrag();
};
//停止拖动
move.onRelease = function() {
this.stopDrag();
};
//同上
move.onReleaseOutside = function() {
this.stopDrag();
};
//扩大按钮的代码。其中的判断用于在缩小按钮不可用时恢复其可用。
bot_D.onPress = function() {
if (suoxiao.enabled == false) {
suoxiao.enabled = true;
}
move.onEnterFrame = function() {
this._yscale = this._xscale += sped_x;
};
};
bot_D.onRelease = function() {
delete move.onEnterFrame;
};
//缩小按钮的代码,其中加的限制条件是为了在缩小时防止背景漏出。
//当达到最小的范围时,缩小按钮不可用。
bot_K.onPress = function() {
move.onEnterFrame = function() {
if (this._width<=(Stage.width+Math.abs(this._x)) || this._height<=(Stage.height+Math.abs(this._y))) {
bot_K.enabled = false;
} else {
this._yscale = this._xscale -= sped_x;
}
};
};
bot_K.onRelease = function() {
delete pic.onEnterFrame;
};
}
Dat(pic, kuoda, suoxiao, 1, 1);
- 暂存AS代码
- 代码暂存
- 参考暂存 方法 代码
- KMP 代码 暂存
- Html练习代码暂存
- Css练习代码暂存
- Css3练习代码暂存
- Javascipt 代码暂存
- Bootstrap 练习代码暂存
- jQuery练习代码暂存
- 全页式网站 练习代码暂存
- 暂存
- 暂存
- 暂存
- 暂存
- 暂存
- 暂存
- 暂存
- .NET之语言互操作
- [原创]轻轻的,我走了,离开了这里,踏上了新的旅途
- 在asp中,写一个显示的java脚本
- 一款漂亮的韩国导航条教程
- 程序员随笔(5)
- 暂存AS代码
- 第一次使用CSDN的blob
- 基于Web的系统测试方法(张友生(来自中国系统分析师/中国系统分析员))
- 终于被手机中奖的骗子看上了[13055464137]
- 免费短信“黑幕”及应对方法
- 怎样防止多用户同时生成一个批次号(该批次号是某个表的pk)
- 四大漏洞将毁灭博客
- 这是最好的时代 这是最坏的时代
- 父 子