# Zoom / Size multiplier?

**URL:** <https://forum.kirupa.com/t/zoom-size-multiplier/269248>\
**Category:** flash\
**Created:** [August 25, 2008, 10:29am UTC](https://forum.kirupa.com/t/zoom-size-multiplier/269248 "2008-08-25T10:29:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sceme](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sceme](https://forum.kirupa.com/u/sceme)\
**Post date:** [August 25, 2008, 10:29am UTC](https://forum.kirupa.com/t/zoom-size-multiplier/269248/1 "2008-08-25T10:29:50Z")

</div>

Long time since I have posted here. Anyway I ran in to a quite silly issue.  
I am making a simple map site with flash and trying to implement a zoom function.  
Problem is that I can’t find anywhere a simple math code to multiply the size of an object when performing sertain mouse click or such.

This is the code I’m using now to test the map:

---------------- code ------------

//Simply tells the mov\_map (which is the movie clip containing all map data) to have a normal size  
mov\_map.scaleX = 1;  
mov\_map.scaleY = 1;

//Adds mouse event  
mov\_map.addEventListener(MouseEvent.CLICK, onMclick);

//adds a function that when mouse clicked the map gets sized double of original size.  
function onMclick(event:MouseEvent):void {  
mov\_map.scaleX = 2;  
mov\_map.scaleY = 2;  
}

---------------- /code -----------

So as you can see this only allows the user to zoom between two levels, which is kind of stupid in map based site. (I have zoom out function which simply sets the size to one again so I didn’t put it here since it’s not the issue)

All I’m asking if anyone knows a very simple way to make it so when clicked the size would always double and double. Should be simple math code I assume but I’m very bad at those and have been looking around without results.

Thank you very much for advance.
