Hola chicos,
como en el tema tengo un problema con una vista panorámica. Im tratando de crear una vista panorámica que puede ser vista en cualquier tamaño del navegador. Por desgracia, el trabajo dosent como me gustaría, sobre todo, en alta resolución. ¿Qué tengo que hacer es cambiar un valor de acuerdo con una resolución adecuada. Por ejemplo:
if (Stage.width> 959 & & Stage.width <1300)
(
Myvalue = 2;
)
o
if (Stage. ancho> 1500)
(
Myvalue = 5;
)
Mi código es el siguiente:
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 intentado resolverlo, pero no pude. ¿Podría alguien me de una función de trabajo o sth

?
TY por adelantado.