Flash as3 以鼠标点为中心缩放效果
新建一个元件,名称为pic
pic.addEventListener (MouseEvent.MOUSE_WHEEL,zoomHandler); function zoomHandler (e:MouseEvent) { if (e.delta > 0) { e.currentTarget.scaleX += 0.1; e.currentTarget.scaleY += 0.1; e.currentTarget.x=mouseX-e.localX*(e.currentTarget.scaleX); e.currentTarget.y=mouseY-e.localY*(e.currentTarget.scaleY); } else { e.currentTarget.scaleX -= 0.1; e.currentTarget.scaleY -= 0.1; e.currentTarget.x=mouseX-e.localX*(e.currentTarget.scaleX); e.currentTarget.y=mouseY-e.localY*(e.currentTarget.scaleY); } }
//可以适当加入TweenLite的缓动效果,是的效果平滑绚丽,同时支持多点触摸设备的对Flash内容的放大缩小
转自:http://hi.baidu.com/sl19880127sl/item/2eb2a160c1f64092c5d24923