3 Replies Latest reply on Dec 13, 2010 7:46 PM by Ned Murphy

    Help with panning image

    Spawn NZ

      Hi There


      I'm building a site that features a panning panoramic image with buttons embedded into it. I've got a piece of script that does it for me, but I have two issues.


      1. My panning image is 500 pixels high and my document is 700px, right now the pan effect works anywhere, but I'd like to limit it to work only when the cursor is over the image (500px in the centre with 100px of white at the top and bottom). So basicly need some sort of 'if' variable for y axis...


      2. Also would like to know if it is possible to stop the pan if the cursor moves away from the image area. Right now if you are panning sideways and you move the mouse out, it will keep panning untill it reaches the end of the image.


      Script that I'm using:


      _global.plotis = Stage.width;
      centre._x = _global.plotis / 2;
      speed = 40;
      full._y = 50;




      delete this.onMouseMove;


      this.onEnterFrame = function(){  
          if(_xmouse<150 || _xmouse>750){
          var A:Boolean = false;
          var X = _xmouse - _global.plotis / 2;
          full._x += -X / speed;
          if (full._x >= 0) {
              full._x = 0;
          if (full._x <= -(full._width - _global.plotis)) {
              full._x = -(full._width - _global.plotis);





      thanks a lot,


      Spawn NZ