Zoom in/out
Hello, I have to do an imagen zoom in/out by a double tap in as3 for android. I have resolve the zoom in and a pan:
map_mc.addEventListener(MouseEvent.DOUBLE_CLICK, fl_MouseDoubleClickHandler);
function fl_MouseDoubleClickHandler(event:MouseEvent):void
{
map_mc.scaleX *= 2;
map_mc.scaleY *= 2;
}
/* Evento de toque y arrastre
Permite mover el objeto sujetando y arrastrando el objeto.
*/
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
map_mc.addEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler);
map_mc.addEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler);
var fl_DragBounds:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
function fl_TouchBeginHandler(event:TouchEvent):void
{
event.target.startTouchDrag(event.touchPointID, false, fl_DragBounds);
}
if(event.phase==fl_TouchBeginHandler.BEGIN){
map_mc.removeEventListener(MouseEvent.DOUBLE_CLICK, fl_MouseDoubleClickHandler);
}
function fl_TouchEndHandler(event:TouchEvent):void
{
event.target.stopTouchDrag(event.touchPointID);
}
map mc is the image.
How can I do the zoom out by another double tap?
Thank you
