[AS3]as3加了缓动效果的鼠标滚轮事件代码示例
[AS3]as3加了缓动效果的鼠标滚轮事件代码示例
[AS3]as3加了缓动效果的鼠标滚轮事件代码示例
- import fl.transitions.*;
- import fl.transitions.easing.*;
- var a:Number = 1;
- var k:Number = 0.2;
- var time:Number = 0.8;
- var myTweenx:Tween;
- var myTweeny:Tween;
- stage.addEventListener(MouseEvent.MOUSE_WHEEL,onMWHandler);
- function onMWHandler(e)
- {
- if (e.delta > 0)
- {
- if (a > 4)
- {
- a = 4;
- }
- else
- {
- a += k;
- myTweenx = new Tween(mc,"scaleX",Strong.easeOut,a,a + k,time,true);
- myTweeny = new Tween(mc,"scaleY",Strong.easeOut,a,a + k,time,true);
- trace("up"+a);
- trace("e.delta:"+e.delta);
- }
- }
- if (e.delta < 0)
- {
- if (a < 0)
- {
- a = 0.1;
- }
- a -= k;
- myTweenx = new Tween(mc,"scaleX",Strong.easeOut,a,a - k,time,true);
- myTweeny = new Tween(mc,"scaleY",Strong.easeOut,a,a - k,time,true);
- trace("down"+a);
- trace("e.delta:"+e.delta);
- }
- }
出处:http://www.cnblogs.com/cos2004/archive/2010/10/13/1849962.html
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例
请稍候...