# Interactive Image Panning Issue

**URL:** https://forum.kirupa.com/t/interactive-image-panning-issue/304725
**Category:** flash
**Created:** [February 12, 2010, 3:15pm UTC](https://forum.kirupa.com/t/interactive-image-panning-issue/304725 "2010-02-12T15:15:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jdinger23](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jdinger23](https://forum.kirupa.com/u/jdinger23)
#### Post date: [February 12, 2010, 3:15pm UTC](https://forum.kirupa.com/t/interactive-image-panning-issue/304725/1 "2010-02-12T15:15:18Z")

</div>

I followed the tutorial and all is working perfect. I am currently working on a virtual tour and I am trying to get a button to gotoAndPlay the next scene.

I have tried to insert a button on the movieclip (scrollingimage) with the code to goto the next scene but whenever I do that it will cause the movieclip to flash white and not proceed to the next scene.  
Here is the code for the button I inserted:

```auto
on (release) {
    gotoAndStop("Office", 1);
}

```

Here is the code for the interactive panning:

```auto
this.onMouseMove = function() {
    constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
    var mousePercent:Number = _xmouse/Stage.width;
    var mSpeed:Number;
    if (dir == 2) {
        mSpeed = 1-mousePercent;
    } else {
        mSpeed = mousePercent;
    }
    target.destX = Math.round(-((target._width-Stage.width)*mSpeed));
    target.onEnterFrame = function() {
        if (target._x == target.destX) {
            delete target.onEnterFrame;
        } else if (target._x>target.destX) {
            target._x -= Math.ceil((target._x-target.destX)*(speed/100));
        } else if (target._x<target.destX) {
            target._x += Math.ceil((target.destX-target._x)*(speed/100));
        }
    };
}

```

Any help would be greatly appreciated!

Thanks.
