1 Reply Latest reply on Oct 25, 2009 12:20 PM by MeadowRyan

    zooming to certain x/y coordinates

    MeadowRyan

      Hello, I've been racking my brain for the last week, and Im trying to use a map to zoom into certain city locations on the map. I believe each city locatio needs to be its own mc on the map, but don't know if I need to zoom into the coordinates of that mc? Here's what I have so far which zooms in on the appropritea x/y coordinates. Does anyone have any advice as how to change this or some other way to zoom into certain locations on a a map?

       

      thanks

       

       

      onClipEvent (mouseDown) {
          if (i>0) {
              return;
          }
          zoom = true;
          dir == 1 ? (dir=-1) : (dir=1);
          if (dir == 1) {
              //pt = {x:_root._xmouse, y:_root._ymouse};
        pt = {x:141.9, y:177};
          }
      }
      onClipEvent (enterFrame) {
          if (!zoom) {
              return;
          }
          _root._xscale += dir*i*30/20;
          _root._yscale += dir*i*25/20;
          var pt2 = {x:pt.x, y:pt.y};
          _root.localToGlobal(pt2);
          _root._x -= (pt2.x-pt.x);
          _root._y -= (pt2.y-pt.y);
          i++;
          if (i == 12) {
              zoom = false;
              i = 0;
       
          }
      }


      onClipEvent(load)
      {
          var i = 0;  
      }