Panoramic View(left & right) - resolution problems

  • robert_777
  • Born
  • Born
  • robert_777
  • Posts: 1

Post 3+ Months Ago

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:
Code: [ Select ]
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
  };
};
  1. stop ();
  2. var Myvalue: Number;
  3. var dist;
  4. var fraction;
  5. var decel;
  6. var halfWidth = Stage.width / 2;
  7. var newposx = halfWidth;
  8. var currposx;
  9. //As you can see I'm trying to change this line
  10. value should depend on the resolution(different resolution different value)
  11. var range = (_root.panorama_mc._width - Stage.width) / Myvalue;
  12. var currtime;
  13. var now;
  14. var menutriggerdist = 150;
  15. var menumaxscale = 300;
  16. var menumultiplier = 1.500000E+000;
  17. _root.onEnterFrame = function ()
  18. {
  19.   var _loc1 = _root;
  20.   if (_loc1.borders_mc.hittest(_xmouse, _ymouse, true) == false)
  21.   {
  22.     distancex = _loc1.panorama_mc._x - newposx;
  23.     _loc1.panorama_mc._x = _loc1.panorama_mc._x - distancex / decel;
  24.     _loc1.onMouseMove = function ()
  25.     {
  26.       var _loc1 = _root;
  27.       currtime = getTimer();
  28.       dist = _loc1._xmouse - halfWidth;
  29.       fraction = Math.abs(dist / halfWidth);
  30.       decel = fraction * 15 + 5;
  31.       if (dist < 0)
  32.       {
  33.         newposx = halfWidth + fraction * range;
  34.       }
  35.       else
  36.       {
  37.         newposx = halfWidth - fraction * range;
  38.       } // end else if
  39.       _loc1.currposx = _loc1.panorama_mc._x;
  40.     };
  41.     return;
  42.   } // end if
  43.   delete _loc1.onMouseMove;
  44.   _loc1.panorama_mc.onEnterframe = function ()
  45.   {
  46.     var _loc2 = _root;
  47.     now = getTimer();
  48.     var _loc1 = 5;
  49.     decel = 35;
  50.     if (now > currtime + _loc1 * 1000)
  51.     {
  52.       distancex = _loc2.panorama_mc._x - halfWidth;
  53.       _loc2.panorama_mc._x = _loc2.panorama_mc._x - distancex / decel;
  54.     } // end if
  55.   };
  56. };


I've tried to work it out, but I failed. Could somebody provide me with a working function or sth :(?

TY in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.