Hey, this took me a LONG time to sort out so i thought i’d post it online so others find it eaier.
This allows you to zoom on a mc with the mouse scroll while keeping the mc centered by the cursor.
addEventListener(MouseEvent.MOUSE_WHEEL, Zoom);
function Zoom(e:MouseEvent):void
{
var mod:Number = 10;
map_drag.scaleX += e.delta / mod;
map_drag.scaleY += e.delta / mod;
map_drag.x = ((2 * mouseX) - (2 * (e.localX * map_drag.scaleX))) / 2;
map_drag.y = ((2 * mouseY) - (2 * (e.localY * map_drag.scaleY))) / 2;
}
Hope this helps