World jumping between two points?? Need help

Ok so I want to move through my world by dragging it with the mouse, like how Flash, Photoshop, etc. does it when you hold down the spacebar.
The way I have gone about this is by adding a variable to the Scroller class called focusPoint:Point. Which I put the point that I want it to focus on. Then in updateScroll function added
Code:
if (focusPoint) {
             pos = focusPoint;
         } else if (focus) { //..Original code from here on

This makes it set the pos as a point instead of taking it from a DisplayObject. This means I have to localize what I am setting the focusPoint as before setting it, which I believe I have.

Now it works the same way as the drag function in Photoshop and all the other adobe programs, where you hold the spacebar then click and you can drag the screen around. The only problem is once I start to drag it, the World I am dragging starts to switch between 2 different points, neither of which are correct points but seem to equal and opposite distance from the mouse. Once I let go of the mouse button the world stays on one point and everything is fine. As soon as I try dragging it again it does the same exact thing.

Is there something else updating the world that I am not seeing?
Is there so variable I don't know about?

Thank you for your help. I will post code and answer any question if any of it was unclear,
Hey addbrick,

It sounds like you're getting/setting the focusPoint object locally within your display object, instead of globally, so every time your local displayObject moves, the coordinates of the focusPoint change as well. This would result in the rapid switching between two point.

You might be better off doing something as follows in your ENTER_FRAME or Timer function. Rather than dragging the world around, it's easier to move the displayObject that's showing the visual objects attached to the world. The code below assumes that you've previously stored the mouse/focus position in a Point type class variable called mousePos and the displayObject showing everything is called myDisplayObject.
Code:
protected function update( e:Event ):void
{
  if( draggingWorldAround == true && mousePos != null ){
    var oldMousePos:Point = mousePos;
    mousePos.x = stage.mouseX;
    mousePos.y = stage.mouseY;
    var moveDistance:Point = mousePos.subtract( oldMousePos );
    myDisplayObject.x += moveDistance.x;
    myDisplayObject.y += moveDistance.y;
  }
}
Or, similar to the above - give your display sprite(s) a scrollrect.

Personally I use something like this pseudocode

Code:
//if the scrollrect isn't currently null, initialise this somwhere
//the translated position is the mouse's position on screen, plus the distance scrolled
translatedX = mouseX + displaySprite.scrollrect.x;

//set the target point to
targetX = translatedx;      //or  your object's position, or a predefined spot

//move smoothly towards the point , slowing down as we get closer
currentX += (targetx - currentx)/10;

//now center the scrollrect on the translated point)
displaysprite.scrollrect = new rectangle( currentx - (screenwidth/2) , y, screenwidth, screenheight);


pop this in your ENTER_FRAME, update, or whatever you call it, and just set targetX.
not really checked this for errors, but the idea's solid. The bonus here is that you can test
your object sprite's positions to see if they're within this rectangle to determine whether or
not they should be visible - can save a few FPS here and there!
Ok I figured it out. It was taking the already global point and making it global again so it was way off. I fixed it by telling it to just return once it set the position.

Thanks for your help.

Original thread: https://box2d.org/forum/viewtopic.php?t=5284