# Interactive image pan!

**URL:** <https://forum.kirupa.com/t/interactive-image-pan/209446>\
**Category:** Uncategorized\
**Created:** [December 8, 2006, 9:02pm UTC](https://forum.kirupa.com/t/interactive-image-pan/209446 "2006-12-08T21:02:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madshm](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Madshm](https://forum.kirupa.com/u/Madshm)\
**Post date:** [December 8, 2006, 9:02pm UTC](https://forum.kirupa.com/t/interactive-image-pan/209446/1 "2006-12-08T21:02:48Z")

</div>

Hey

I’m not really good at the AS part of flash so I’m hoping to get some help here… I wanna have a image pan that’s working on both X and Y axis in the same time…

The best example i can give you is:

> **[Chromazone - Specialist display imaging](https://chromazone-imaging.co.uk/)**
>
> Chromazone has invested in the latest large format printing technology to produce material for any display or exhibition requirement | Chromazone Imaging

I’ve tried to modify the code:

> 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 == 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 {  
> target.\_x += Math.ceil((target.destX-target.\_x)_(speed/100));  
> }  
> };  
> }

without any lock though…

cheers…
