现在,我正在开发一个Flash项目。我有一张地图,我想添加放大/缩小和拖动功能。想法是地图将放大/缩小到点击的区域。然后可以通过用户控制鼠标来拖放。有人可以帮忙吗?
当前代码:
var tzoom_out:toolzoomout = new toolzoomout();
kurang.addEventListener(MouseEvent.MOUSE_UP, mini);
function mini(e:MouseEvent):void{
addChild(tzoom_out);
Mouse.hide();
peta.addEventListener(MouseEvent.MOUSE_MOVE, ganti);
function ganti(e:MouseEvent){
tzoom_out.x = mouseX;
tzoom_out.y = mouseY;
tzoom_out.addEventListener(MouseEvent.MOUSE_DOWN, perkecil);
function perkecil(e:MouseEvent){
peta.scaleX -= .1;
peta.scaleY -= .1;
}
}
}