Vistas panorámicas (izquierda y derecha) - problemas de resolución

  • robert_777
  • Born
  • Born
  • No Avatar
  • Registrado: Nov 17, 2009
  • Mensajes: 1
  • Status: Offline

Nota Noviembre 17th, 2009, 8:05 pm

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:
Código: [ 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. };


Ive intentado resolverlo, pero no pude. ¿Podría alguien me de una función de trabajo o sth :( ?

TY por adelantado.
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Noviembre 17th, 2009, 8:05 pm

Publicar Información

  • Total de mensajes en este tema: 1 mensaje
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 33 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC