点击图片放大或缩小,图片能放大到2000*1368,flash尺寸大小是950*650,我想鼠标点击放大 只在这950*650这范围能点击。哪位高手给我写下代码,万分感谢!
as如下
function scale_mc(sc)
{
if (zoom)
{
xp = -_root._xmouse * (sc - 1);
yp = -_root._ymouse * (sc - 1);
zoom = 0;
}
else
{
xp = 0;
yp = 0;
zoom = 1;
} // end else if
xsc = sc * 100;
ysc = sc * 100;
} // End of the function
function scale_this(factor)
{
xsc = factor * 100;
ysc = factor * 100;
} // End of the function
function grow(g)
{
btn._xscale = btn._xscale + (xsc - btn._xscale) / g;
btn._yscale = btn._yscale + (ysc - btn._yscale) / g;
} // End of the function
xsc = 100;
ysc = 100;
xp = 0;
yp = 0;
easing = 1;
mc.onEnterFrame = function ()
{
mc._xscale = mc._xscale + (xsc - mc._xscale) / easing;
mc._yscale = mc._yscale + (ysc - mc._yscale) / easing;
mc._x = mc._x + (xp - mc._x) / easing;
mc._y = mc._y + (yp - mc._y) / easing;
trace (xp);
};
factor = 4;
easing = 6;
zoom = 1;
btn.onMouseMove = function ()
{
btn._x = _root._xmouse;
btn._y = _root._ymouse;
if (!zoom)
{
xp = -_root._xmouse * ((xsc - 100) / 100);
yp = -_root._ymouse * ((ysc - 100) / 100);
} // end if
};
btn.onMouseDown = function ()
{
if (hitTest(_root._xmouse, _root._ymouse, false))
{
if (factor == 1)
{
scale_mc(factor);
scale_this(factor);
factor = 4;
}
else
{
scale_mc(factor);
scale_this(factor);
factor = 4;
} // end if
} // end else if
};
btn.onEnterFrame = function ()
{
grow(easing);
};