看到你回复的鼠标滚轮缩放影片剪辑。我找了好久。要以鼠标所在坐标缩放,应该怎么加以修改??
看到你回复的鼠标滚轮缩放影片剪辑。我找了好久。要以鼠标所在坐标缩放,应该怎么加以修改??如果能帮我解决本人感激不尽.....Q690331938mouseListener...
看到你回复的鼠标滚轮缩放影片剪辑。我找了好久。要以鼠标所在坐标缩放,应该怎么加以修改?? 如果能帮我解决 本人感激不尽.....Q690331938
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
map_mc._xscale += delta;
map_mc._yscale += delta;
}
Mouse.addListener(mouseListener);
203
**错误** 场景=场景 1, 图层=图层 1, 帧=1:第 2 行: 无法加载类或接口'MouseEvent'
function zoomHandler (e:MouseEvent) 展开
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
map_mc._xscale += delta;
map_mc._yscale += delta;
}
Mouse.addListener(mouseListener);
203
**错误** 场景=场景 1, 图层=图层 1, 帧=1:第 2 行: 无法加载类或接口'MouseEvent'
function zoomHandler (e:MouseEvent) 展开
2个回答
展开全部
新建一个元件,名称为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);
}
}
as3的
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);
}
}
as3的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询