i am using my code at the minute whereby when you click a button it activates a cursor and a function which allows you to click 3 times and with every click it zooms in. but i then want to be able to click a zoom out button which activates a different function whereby you can click 3 times dependant on the state.
below is my code
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import fl.motion.MatrixTransformer;
{
const TWEEN_IN:String = "tweenIn";
const TWEEN_IN1:String = "tweenIn1";
const TWEEN_IN2:String = "tweenIn2";
const TWEEN_OUT:String = "tweenOut";
var tweenDirection:String;

var internalPoint:Point;
var externalPoint:Point;
var tw:Tween;
zoomBtn.addEventListener(MouseEvent.CLICK, activateZoomIn);


function activateZoomIn(event:MouseEvent):void
{

mapContainer.insideMap.addEventListener(MouseEvent .CLICK, zoomIn);
mapContainer.insideMap.addEventListener(MouseEvent .MOUSE_MOVE,redrawCursor);

function redrawCursor(event:MouseEvent):void
{
Mouse.hide();
mapContainer.zoomInPointer.x = mapContainer.mouseX;
mapContainer.zoomInPointer.y = mapContainer.mouseY;
}

function zoomIn($e:MouseEvent):void
{
mapContainer.insideMap.addEventListener(MouseEvent .CLICK, zoomIn1);
mapContainer.insideMap.removeEventListener(MouseEv ent.CLICK, zoomIn);

internalPoint = new Point(mapContainer.insideMap.mouseX, mapContainer.insideMap.mouseY);
externalPoint = new Point(mapContainer.insideMap.mouseX, mapContainer.insideMap.mouseY);

tweenDirection = TWEEN_IN;

tw = new Tween(null, "", Strong.easeOut, mapContainer.insideMap.scaleX, 2, 1, true);
tw.addEventListener(TweenEvent.MOTION_CHANGE, _syncScale);
tw.addEventListener(TweenEvent.MOTION_FINISH, _cleanTween);
}
function zoomIn1($e:MouseEvent):void

{
mapContainer.insideMap.addEventListener(MouseEvent .CLICK, zoomIn2);
mapContainer.insideMap.removeEventListener(MouseEv ent.CLICK, zoomIn1);

internalPoint = new Point(mapContainer.insideMap.mouseX, mapContainer.insideMap.mouseY);
externalPoint = new Point(mapContainer.insideMap.mouseX, mapContainer.insideMap.mouseY);

tweenDirection = TWEEN_IN1;

tw = new Tween(null, "", Strong.easeOut, mapContainer.insideMap.scaleX, 3, 1, true);
tw.addEventListener(TweenEvent.MOTION_CHANGE, _syncScale);
tw.addEventListener(TweenEvent.MOTION_FINISH, _cleanTween);
}
function zoomIn2($e:MouseEvent):void
{
mapContainer.insideMap.removeEventListener(MouseEv ent.CLICK, zoomIn2);

internalPoint = new Point(mapContainer.insideMap.mouseX, mapContainer.insideMap.mouseY);
externalPoint = new Point(mapContainer.insideMap.mouseX, mapContainer.insideMap.mouseY);

tweenDirection = TWEEN_IN2;

tw = new Tween(null, "", Strong.easeOut, mapContainer.insideMap.scaleX, 4, 1, true);
tw.addEventListener(TweenEvent.MOTION_CHANGE, _syncScale);
tw.addEventListener(TweenEvent.MOTION_FINISH, _cleanTween);
}


function _syncScale($e:TweenEvent):void
{
mapContainer.insideMap.scaleX = mapContainer.insideMap.scaleY = tw.position;

var matrix:Matrix = mapContainer.insideMap.transform.matrix;

MatrixTransformer.matchInternalPointWithExternal(m atrix, internalPoint, externalPoint);

mapContainer.insideMap.transform.matrix = matrix;
}

function _cleanTween($e:TweenEvent):void
{
tw.removeEventListener(TweenEvent.MOTION_CHANGE, _syncScale);
tw.removeEventListener(TweenEvent.MOTION_FINISH, _cleanTween);

tw = null;

if(tweenDirection == TWEEN_IN)
mapContainer.insideMap.addEventListener(MouseEvent .CLICK, zoomIn1);
if(tweenDirection == TWEEN_IN1)
mapContainer.insideMap.addEventListener(MouseEvent .CLICK,zoomIn2);
else if(tweenDirection == TWEEN_OUT)
mapContainer.insideMap.addEventListener(MouseEvent .CLICK, zoomIn);
}