- UID
- 200588
- 阅读权限
- 40
- 注册时间
- 2014-8-4
- 最后登录
- 2015-12-22
- 在线时间
- 250 小时
- 性别
- 保密
- 生日
- 2000 年 11 月 21 日
子爵
- 耕战
- 16
- 鹰币
- 441
- 天龙币
- 0
- 回帖
- 234

|
AS2.0的镜头代码,即写入一个方块内,挪动方块就能挪动显示的画面。
// Action script...
// [Action in Frame 1]
function camControl()
{
parentColor.setTransform(camColor.getTransform());
var _loc4 = sX / this._width;
var _loc3 = sY / this._height;
_parent._x = cX - this._x * _loc4;
_parent._y = cY - this._y * _loc3;
_parent._xscale = 100 * _loc4;
_parent._yscale = 100 * _loc3;
} // End of the function
function resetStage()
{
var _loc2 = {ra: 100, rb: 0, ga: 100, gb: 0, ba: 100, bb: 0, aa: 100, ab: 0};
parentColor.setTransform(_loc2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
} // End of the function
this._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = Stage.width / 2;
var cY = Stage.height / 2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
转为AS3.0代码怎么转?求解?
|
|