Flash 动画:
我的源代码:
_root.jt._visible = false;
_root.jt._x = -500;
_root.jt._y = -500;
_root.menu1.dao.onPress = function() {
xxx = _root.menu1._x;
yyy = _root.menu1._y;
_root.menu1.onEnterFrame = function() {
if (_root.jt._visible == true) {
startDrag(_root.menu1);
}
};
};
_root.menu1.dao.onRelease = function() {
stopDrag();
xxxx = _root.menu1._x;
yyyy = _root.menu1._y;
n1 = xxx-xxxx;
n2 = yyy-yyyy;
_root.menu1.onEnterFrame = function() {
if (xxxx<xxx) {
_root.menu1._x += ((xxxx-(n1/10))-_root.menu1._x)/30;
}
if (yyyy<yyy) {
_root.menu1._y += ((yyyy-(n2/10))-_root.menu1._y)/30;
}
if (xxxx>xxx) {
_root.menu1._x += ((xxxx-(n1/10))-_root.menu1._x)/30;
}
if (yyyy>yyy) {
_root.menu1._y += ((yyyy-(n2/10))-_root.menu1._y)/30;
}
};
};
_root.menu1.dao.onRollOver = function() {
Mouse.hide();
_root.jt._visible = true;
};
_root.menu1.dao.onRollOut = function() {
Mouse.show();
_root.jt._visible = false;
_root.jt._x = -500;
_root.jt._y = -500;
};
delete xxxx;
delete yyyy;
delete xxx;
delete yyy;
delete n1;
delete n2;