# Interactive Panning - HELP PLEASE!

**URL:** https://forum.kirupa.com/t/interactive-panning-help-please/288183
**Category:** Uncategorized
**Created:** [May 12, 2009, 4:14pm UTC](https://forum.kirupa.com/t/interactive-panning-help-please/288183 "2009-05-12T16:14:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rudeando](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@rudeando](https://forum.kirupa.com/u/rudeando)
#### Post date: [May 12, 2009, 4:14pm UTC](https://forum.kirupa.com/t/interactive-panning-help-please/288183/1 "2009-05-12T16:14:54Z")

</div>

hello pepps!.. i really need your help in this, my client is getting really anxious about it and im loosing my mind!

im performing a interative view module for an appartment and im using the tutorial : [http://www.kirupa.com/developer/flash8/interactive\_image\_pan.htm](http://www.kirupa.com/developer/flash8/interactive_image_pan.htm) … the thing is that this intractive panning swf is being loaded into a main swf, but for the panning movement is using the as Stage.width the main swf size so its not working properly at all … IS THERE A WAY I CAN MAKE THE PANNING MOVEMENT RELATIVE TO THE SPECIFIC SWF???

HERE IS A LITTLE MORE INFORMATION

-html holding main swf file  
- main swf (hmita-u306.swf) loads in a container mc [after clicking in the menu] :  
- hallway-360.swf  
- kitchen-360.swf  
- mainbedroom-360.swf  
- …

also you can take a look in here : [http://www.rudeando.com/portfolio/mita/haciendademitau306.html](http://www.rudeando.com/portfolio/mita/haciendademita306.html)

source file example : [http://www.rudeando.com/portfolio/mita/kitchen-360.fla](http://www.rudeando.com/portfolio/mita/kitchen-360.fla) & swf holder : [URL=“[http://www.rudeando.com/portfolio/mita/hmita-u306.fla](http://www.rudeando.com/portfolio/mita/hmita-u306.fla)”][http://www.rudeando.com/portfolio/mita/hmita-u306.fla](http://www.rudeando.com/portfolio/mita/hmita-u306.fla)

the code im using in this hallway-360.swf, kitchen-360.swf, mainbedroom-360.swf,…

```auto

this.onMouseMove = function() {
    constrainedMove(bg_mc, 8, 8);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
    var mousePercent:Number = _xmouse/Stage.width;
    var mSpeed:Number;
    if (dir == 1) {
        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));
        }
    };
}

```

thank you very much people!!!
