Flash AS 完成对象定点移动

来源:百度知道 编辑:UC知道 时间:2024/05/26 17:21:09
mc里面有一个图像元件(实例名为tx)从第一帧移动到第十帧
现在想用AS来设置它们运动的方向
例如:
第一帧
tx从x=10 y=10
移动到
x=20 y=20
不是瞬间到了20,20,是像有补间那样移动

在你说的帧上写下:
stop();
tx._x = 10;
tx._y = 10;
var tracker = function () {
if (tx._x < 20) {
tx._x += 1;
tx._y += 1;
}
}
tx.onEnterFrame = function () {
setInterval(tracker, 100);
}
你读懂意思后,里面的变量你可以自己适当的改一下