Bonjour,
J'ai bidouillé un code mais il y a une erreur quelquepart....
stop();
var dist;
var fraction;
var decel;
var halfWidth = Stage.height / 2;
var newposy = halfheight;
var range = (_root.panorama_mc._width - Stage.height) / 2;
var halfWidth = Stage.width / 2;
var newposx = halfWidth;
var range = (_root.panorama_mc._width - Stage.width) / 2;
var currtime;
var now;
_root.panorama_but.onRollOver = function ()
{
var _l1 = _root;
_l1.onEnterFrame = function ()
{
var _l1 = _root;
distancex = _l1.panorama_mc._x - newposx;
_l1.panorama_mc._x = _l1.panorama_mc._x - distancex / decel;
distancey = _l1.panorama_mc._y - newposy;
_l1.panorama_mc._y = _l1.panorama_mc._y - distancey / decel;
};
_l1.onMouseMove = function ()
{
currtime = getTimer();
dist = _root._xmouse - halfWidth;
dist = _root._ymouse - halfheight;
fraction = Math.abs(dist / halfheight);
fraction = Math.abs(dist / halfWidth);
decel = fraction * 15 + 5;
if (dist < 0)
{
newposx = halfWidth + fraction * range;
newposy = halfheight + fraction * range;
}
else
{
newposx = halfWidth - fraction * range;
newposy = halfheight - fraction * range;
} // end if
};
};
_root.panorama_but.onRollOut = function ()
{
var _l1 = _root;
delete _l1["onMouseMove"];
_l1.onEnterframe = function ()
{
var _l2 = _root;
now = getTimer();
var _l1 = 15;
decel = 35;
if (now > currtime + _l1 * 1000)
{
distancex = _l2.panorama_mc._x - halfWidth;
_l2.panorama_mc._x = _l2.panorama_mc._x - distancex / decel;
distancey = _l2.panorama_mc._y - halfheight;
_l2.panorama_mc._y = _l2.panorama_mc._y - distancey / decel;
} // end if
};
};
