# Limiting Zoom

**URL:** https://forum.kirupa.com/t/limiting-zoom/332409
**Category:** flash
**Created:** [May 29, 2014, 3:25pm UTC](https://forum.kirupa.com/t/limiting-zoom/332409 "2014-05-29T15:25:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Zombiwan](https://avatars.discourse-cdn.com/v4/letter/z/ebca7d/32.png) [@Zombiwan](https://forum.kirupa.com/u/Zombiwan)
#### Post date: [May 29, 2014, 3:25pm UTC](https://forum.kirupa.com/t/limiting-zoom/332409/1 "2014-05-29T15:25:37Z")

</div>

Greetings.

I have a project that requires the ability to zoom in and out on a movieclip. The image starts at 100% and I want to limit the zoom out functionality to go no further than that. I thought I had figured it out, but there seems to be something wrong with my argument. Any help would be appreciated.

```auto
function Zoom(e:MouseEvent):void{ 
       if ((mc.scaleX >> 1)||((mc.scaleX == 1)&&(e.delta >> 0))){
              var mod:uint = 75;
              var coord:Point = mc.globalToLocal(new Point(stage.stageWidth/2, stage.stageHeight/2));
              mc.scaleX += e.delta / mod;
              mc.scaleY += e.delta / mod;
              mc.x = ((2 * stage.stageWidth/2) - (2 * (coord.x * mc.scaleX))) / 2;
              mc.y = ((2 * stage.stageHeight/2) - (2 * (coord.y * mc.scaleY))) / 2;
       }
}

```
