-
Zoom to the mouse position problem
Hello!
Ive got this code for zoom, but its zoom to the center of the image, but i would like to zoom to the mouse position. HELP ME PLEASE!
import flash.events.MouseEvent;
stage.addEventListener(MouseEvent.MOUSE_WHEEL, Zoom);
function Zoom(e:MouseEvent):void
{
var mod:Number = 20;
kep2.scaleX += e.delta / mod;
kep2.scaleY += e.delta / mod;
if(kep2.scaleX<1){
kep2.scaleX=kep2.scaleY=1;
}
kep2.scaleX *= Math.max(scaleY,scaleX);
kep2.scaleY *= Math.max(scaleX,scaleY);
THANKS FOR YOUR HELP
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|