Salut les gars,
comme dans le sujet j'ai un problème avec une vue panoramique. Im essayant de créer une vue panoramique qui pourrait être considérée dans toutes les dimensions du navigateur. Malheureusement, ce travail dosent comme je voudrais, en particulier, dans des résolutions plus élevées. Ce que je dois faire est de changer une valeur en conséquence avec une résolution appropriée. Par exemple:
if (Stage.width> 959 & & Stage.width <1300)
(
Myvalue = 2;
)
ou
if (Stage. largeur> 1500)
(
Myvalue = 5;
)
Mon code ressemble à ceci:
stop ();
var Myvalue: Number;
var dist;
var fraction;
var decel;
var halfWidth = Stage.width / 2;
var newposx = halfWidth;
var currposx;
//As you can see I'm trying to change this line
value should depend on the resolution(different resolution different value)
var range = (_root.panorama_mc._width - Stage.width) / Myvalue;
var currtime;
var now;
var menutriggerdist = 150;
var menumaxscale = 300;
var menumultiplier = 1.500000E+000;
_root.onEnterFrame = function ()
{
var _loc1 = _root;
if (_loc1.borders_mc.hittest(_xmouse, _ymouse, true) == false)
{
distancex = _loc1.panorama_mc._x - newposx;
_loc1.panorama_mc._x = _loc1.panorama_mc._x - distancex / decel;
_loc1.onMouseMove = function ()
{
var _loc1 = _root;
currtime = getTimer();
dist = _loc1._xmouse - halfWidth;
fraction = Math.abs(dist / halfWidth);
decel = fraction * 15 + 5;
if (dist < 0)
{
newposx = halfWidth + fraction * range;
}
else
{
newposx = halfWidth - fraction * range;
} // end else if
_loc1.currposx = _loc1.panorama_mc._x;
};
return;
} // end if
delete _loc1.onMouseMove;
_loc1.panorama_mc.onEnterframe = function ()
{
var _loc2 = _root;
now = getTimer();
var _loc1 = 5;
decel = 35;
if (now > currtime + _loc1 * 1000)
{
distancex = _loc2.panorama_mc._x - halfWidth;
_loc2.panorama_mc._x = _loc2.panorama_mc._x - distancex / decel;
} // end if
};
};
- stop ();
- var Myvalue: Number;
- var dist;
- var fraction;
- var decel;
- var halfWidth = Stage.width / 2;
- var newposx = halfWidth;
- var currposx;
- //As you can see I'm trying to change this line
- value should depend on the resolution(different resolution different value)
- var range = (_root.panorama_mc._width - Stage.width) / Myvalue;
- var currtime;
- var now;
- var menutriggerdist = 150;
- var menumaxscale = 300;
- var menumultiplier = 1.500000E+000;
- _root.onEnterFrame = function ()
- {
- var _loc1 = _root;
- if (_loc1.borders_mc.hittest(_xmouse, _ymouse, true) == false)
- {
- distancex = _loc1.panorama_mc._x - newposx;
- _loc1.panorama_mc._x = _loc1.panorama_mc._x - distancex / decel;
- _loc1.onMouseMove = function ()
- {
- var _loc1 = _root;
- currtime = getTimer();
- dist = _loc1._xmouse - halfWidth;
- fraction = Math.abs(dist / halfWidth);
- decel = fraction * 15 + 5;
- if (dist < 0)
- {
- newposx = halfWidth + fraction * range;
- }
- else
- {
- newposx = halfWidth - fraction * range;
- } // end else if
- _loc1.currposx = _loc1.panorama_mc._x;
- };
- return;
- } // end if
- delete _loc1.onMouseMove;
- _loc1.panorama_mc.onEnterframe = function ()
- {
- var _loc2 = _root;
- now = getTimer();
- var _loc1 = 5;
- decel = 35;
- if (now > currtime + _loc1 * 1000)
- {
- distancex = _loc2.panorama_mc._x - halfWidth;
- _loc2.panorama_mc._x = _loc2.panorama_mc._x - distancex / decel;
- } // end if
- };
- };
Ive a essayé de le travailler, mais j'ai échoué. Quelqu'un pourrait-il me fournir une fonction de travail ou STH

?
TY à l'avance.