Hi guys,
like in the topic I have a problem with a panoramic view. I'm trying to create a panoramic view that could be viewed in any size of the browser. Unfortunately, it dosen't work as I would like to, especially, in higher resolutions. What I need to do is to change one value accordingly with a proper resolution. For instance:
if (Stage.width > 959 && Stage.width < 1300)
{
Myvalue = 2;
}
or
if (Stage.width > 1500)
{
Myvalue = 5;
}
My code looks like this:
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
- };
- };
I've tried to work it out, but I failed. Could somebody provide me with a working function or sth

?
TY in advance.