3 Replies Latest reply on Apr 1, 2009 4:08 AM by danwel1

    Flash Map Zoom

      I have designed a map that you can zoom in on, which works great, the only problem is once you have zoomed in on the map I have tried to make it so that you can then click on the image of location that it will take you to a url location. After I set this the way and then when I click it doesn't go to the location I specified? Quite Strange.
      I have included the actionscript code below:

      onClipEvent (mouseDown)
      {
      if (i>0)
      {
      return;
      }
      zoom = true;
      dir == 1 ? (dir=-1) : (dir=1);
      if (dir == 1)
      {
      pt = {x:_root.fotos._xmouse, y:_root.fotos._ymouse};
      }
      }

      onClipEvent (enterFrame)
      {
      if (!zoom)
      {
      return;
      }
      _root.fotos._xscale += dir*i*100/12;
      _root.fotos._yscale += dir*i*100/12;
      var pt2 = {x:pt.x, y:pt.y};
      _root.fotos.localToGlobal(pt2);
      _root.fotos._x -= (pt2.x-pt.x);
      _root.fotos._y -= (pt2.y-pt.y);
      i++;
      if (i == 9)
      {
      zoom = false;
      i = 0;
      }
      }

      Fore reference of what I have done visually - http://www.uppicth.com/pics/bc07a02b9749117ce92e8f1e970411b7.gif Map">Map
        • 1. Re: Flash Map Zoom
          Ned Murphy Adobe Community Professional & MVP
          There's nothing in your code that I can associate with going to a url.
          • 2. Re: Flash Map Zoom
            Level 1
            Apologies, I forgot to add the following:

            // script button in movie clip


            on(release){

            getURL(" http://www.xxxxx.com");

            }

            can not link to url

            //Script movie clip in main scene


            my_mc.zscale = 0;
            my_mc.zspeed = 0.55;
            my_mc.zoomin = true;
            my_mc.xreturn = my_mc._x;
            my_mc.yreturn = my_mc._y;
            my_mc.onRelease = onClickZoom;
            function onClickZoom(Void):Void {
            this.xfocus = this.xreturn;
            this.yfocus = this.yreturn;
            if (this.zoomin) {
            this.zoomin = false;
            this.zscale = 473;
            this.xfocus += (this.xreturn - _xmouse) * this.zscale / 100;
            this.yfocus += (this.yreturn - _ymouse) * this.zscale / 100;
            this.onEnterFrame = onZoom;
            } else {
            this.zoomin = true;
            this.zscale = 100;
            this.onEnterFrame = onZoom;
            }
            }
            function onZoom(Void):Void {
            with (this) {
            if (Math.abs(zscale - _xscale) > 0.5) {
            _xscale += (zscale - _xscale) * zspeed;
            _yscale = _xscale;
            _x += (xfocus - _x) * zspeed;
            _y += (yfocus - _y) * zspeed;
            } else {
            _xscale = zscale;
            _yscale = zscale;
            _x = xfocus;
            _y = yfocus;
            delete onEnterFrame;
            }
            }
            }
            • 3. Re: Flash Map Zoom
              Level 1
              Ok can someone help me?