# Image panning inside a movie clip

**URL:** https://forum.kirupa.com/t/image-panning-inside-a-movie-clip/287360
**Category:** Uncategorized
**Created:** [April 29, 2009, 8:51pm UTC](https://forum.kirupa.com/t/image-panning-inside-a-movie-clip/287360 "2009-04-29T20:51:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![prettywoman](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@prettywoman](https://forum.kirupa.com/u/prettywoman)
#### Post date: [April 29, 2009, 8:51pm UTC](https://forum.kirupa.com/t/image-panning-inside-a-movie-clip/287360/1 "2009-04-29T20:51:05Z")

</div>

[COLOR=black][FONT=Verdana]hey guys,[/FONT][/COLOR]  
[COLOR=black][FONT=Verdana]does anybody know how to change the tutorial on interactive image panning so it can be executed in a movie clip with restricted area?[/FONT][/COLOR]  
[COLOR=black][FONT=Verdana]here is the code which i am sure you all have seen it. in case of not spending time to look back:[/FONT][/COLOR]

[COLOR=#0000d0]this[/COLOR].[COLOR=#0000d0]onMouseMove[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#006610]function[/COLOR]COLOR=#0000ff[/COLOR] [COLOR=#0000ff]{[/COLOR]  
[COLOR=#000050]constrainedMove[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#000050]bg\_mc[/COLOR], [COLOR=#991010]4[/COLOR], [COLOR=#991010]1[/COLOR][COLOR=#0000ff])[/COLOR]; [COLOR=#0000ff]}[/COLOR];  
[COLOR=#006610]function[/COLOR] [COLOR=#000050]constrainedMove[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#0000d0]target[/COLOR][COLOR=#0000ff]:[/COLOR][COLOR=#0000d0]MovieClip[/COLOR], [COLOR=#000050]speed[/COLOR][COLOR=#0000ff]:[/COLOR][COLOR=#0000d0]Number[/COLOR], [COLOR=#000050]dir[/COLOR][COLOR=#0000ff]:[/COLOR][COLOR=#0000d0]Number[/COLOR][COLOR=#0000ff])[/COLOR] [COLOR=#0000ff]{[/COLOR]  
[COLOR=#006610]var[/COLOR] [COLOR=#000050]mousePercent[/COLOR][COLOR=#0000ff]:[/COLOR][COLOR=#0000d0]Number[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#0000d0]\_xmouse[/COLOR][COLOR=#0000ff]/[/COLOR][COLOR=#0000d0]Stage[/COLOR].[COLOR=#0000d0]width[/COLOR];  
[COLOR=#006610]var[/COLOR] [COLOR=#000050]mSpeed[/COLOR][COLOR=#0000ff]:[/COLOR][COLOR=#0000d0]Number[/COLOR];  
[COLOR=#006610]if[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#000050]dir[/COLOR] [COLOR=#0000ff]==[/COLOR] [COLOR=#991010]1[/COLOR][COLOR=#0000ff])[/COLOR] [COLOR=#0000ff]{[/COLOR] [COLOR=#000050]mSpeed[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#991010]1[/COLOR][COLOR=#0000ff]-[/COLOR][COLOR=#000050]mousePercent[/COLOR]; [COLOR=#0000ff]}[/COLOR]  
[COLOR=#006610]else[/COLOR] [COLOR=#0000ff]{[/COLOR] [COLOR=#000050]mSpeed[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#000050]mousePercent[/COLOR]; [COLOR=#0000ff]}[/COLOR]  
[COLOR=#0000d0]target[/COLOR].[COLOR=#000050]destX[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#0000d0]Math[/COLOR].[COLOR=#0000d0]round[/COLOR]COLOR=#0000ff[/COLOR]; [COLOR=#0000d0]target[/COLOR].[COLOR=#0000d0]onEnterFrame[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#006610]function[/COLOR]COLOR=#0000ff[/COLOR] [COLOR=#0000ff]{[/COLOR]  
[COLOR=#006610]if[/COLOR] [COLOR=#0000ff]([/COLOR][COLOR=#0000d0]target[/COLOR].[COLOR=#0000d0]\_x[/COLOR] [COLOR=#0000ff]==[/COLOR] [COLOR=#0000d0]target[/COLOR].[COLOR=#000050]destX[/COLOR][COLOR=#0000ff])[/COLOR] [COLOR=#0000ff]{[/COLOR]  
[COLOR=#006610]delete[/COLOR] [COLOR=#0000d0]target[/COLOR].[COLOR=#0000d0]onEnterFrame[/COLOR];  
[COLOR=#0000ff]}[/COLOR] [COLOR=#006610]else[/COLOR] [COLOR=#0000ff]{[/COLOR]  
[COLOR=#0000d0]target[/COLOR].[COLOR=#0000d0]\_x[/COLOR] [COLOR=#0000ff]+=[/COLOR] [COLOR=#0000d0]Math[/COLOR].[COLOR=#0000d0]ceil[/COLOR]COLOR=#0000ff[/COLOR]; [COLOR=#0000ff]}[/COLOR] [COLOR=#0000ff]}[/COLOR]; [COLOR=#0000ff]}[/COLOR]

[COLOR=black][FONT=Verdana]i wish somebody help me out I need it for the project i am doing and it has a photo gallery in it. i need this for panning the thumbnail. aim not sure if it will work they way i want.[/FONT][/COLOR]  
[COLOR=black][FONT=Verdana]please if anyone how to do it answer as soon as possible, thanks.[/FONT][/COLOR]
