# Zooming/panning multiple movieclips

**URL:** https://forum.kirupa.com/t/zooming-panning-multiple-movieclips/300785
**Category:** flash
**Created:** [November 27, 2009, 11:39am UTC](https://forum.kirupa.com/t/zooming-panning-multiple-movieclips/300785 "2009-11-27T11:39:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nallath](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nallath](https://forum.kirupa.com/u/nallath)
#### Post date: [November 27, 2009, 11:39am UTC](https://forum.kirupa.com/t/zooming-panning-multiple-movieclips/300785/1 "2009-11-27T11:39:00Z")

</div>

There are tons of example explaining how to zoom/pan a single movieclip, but im looking for a way to zoom AND pan multiple movieclips.

So far ive been able to zoom or pan, but not both at the same time.

Im using this for the zooming and works perfectly. But how can i let the movieclips pan properly with a maximum pan?

```auto
public function zoom(action:String) {
 var zoomType:Number;
 var scaleType:Number;
 if(action == "in"){
  zoomType = 1.01;
  scaleType = 0.99;
  zoomed += 0.01;
 } else if(action == "out"){
  zoomType = 0.99;
  scaleType = 1.01;
  zoomed -= 0.01;
 }
 for (var i:int = 0; itemArray.length >i; i++) {
  itemArray*.x = mouseX - ((mouseX - itemArray*.x) * zoomType);
  itemArray*.y = mouseY - ((mouseY - itemArray*.y) * zoomType);
  itemArray*.scaleX /=scaleType;
  itemArray*.scaleY /= scaleType;
}

```
