[ActionScript 3.0] 实现放大镜效果的简单方法
//mc和bgmc是同一对象的不同实例 //mc放大的对象 //bgmc源对象 //mag放大镜 var scale:Number = 1.3;//放大倍数 mc.mask = mag; mag.startDrag(); mc.scaleX = mc.scaleY = scale; addEventListener(Event.ENTER_FRAME,onEnter); function onEnter(e:Event):void { mag.x = mouseX; mag.y = mouseY; mc.x = - scale * mag.x - bgmc.x + mag.x; mc.y = - scale * mag.y - bgmc.y + mag.y; }
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------
浙公网安备 33010602011771号