初学AS必须用2.0而且很多库不能用。移动的关键是mc._xmouse和mc._ymouse不能变
mc.onEnterFrame = function()
{
if (isPress)
{
sx = _root._xmouse - mc._x;
sy = _root._ymouse - mc._y;
dx = sx - old_x ;
dy = sy - old_y;
mc._x = mc._x + dx * 0.3;
mc._y = mc._y + dy * 0.3;
}
else
{
trace("else" + isPress);
mc._x = mc._x;
mc._y = mc._y;
}
};
// var isPress = false;
mc.onPress = function()
{
old_x = mc._xmouse;
old_y = mc._ymouse;
isPress = true;
};
mc.onRelease = function()
{
isPress = false;
};
mc.onReleaseOutside = mc.onRelease;