2011-11-14 146 views
1

我是新手程序员。Flash滚动浏览影片剪辑

我想简单地使用我的鼠标滚轮浏览Flash动画片段。这是我迄今为止所做的工作(http://www.stopitstudy.com/test.html)。每个图像都是影片剪辑中的单独框架。

我曾在Flash AS2中工作,但突然间网页开始滚动以及滚动鼠标滚轮。

我看到这里有一个解决方案:http://labs.byhook.com/2010/04/09/flash-mouse-wheel-support/

有没有人,可以使一个基本的.fla关于如何使用它的说明???

谢谢!

回答

0

在您的FLA时间线文件中创建一个新图层。选择此图层的第一帧。打开“操作”窗口。添加此AS3代码:

import flash.events.MouseEvent; 

stop(); 

stage.addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheelHnd); 

function mouseWheelHnd(e:MouseEvent):void 
{ 
    if (e.delta > 0) { 
     gotoAndStop(currentFrame + 1); 
    } else if (e.delta < 0) { 
     gotoAndStop(currentFrame - 1); 
    } 
}