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.