ActionScript实现转动鼠标滚轮与左右控制菜单(代码)

      Flash学习 2005-8-9 17:16
效果如下:

Flash 动画

=============代码如下======================
//onEnterFrame的函数用动态指定的
function myOnEnterFrame(target:MovieClip,nR:Number,nS:Number){
    target._rotation+=_xmouse>target._x?nR:_xmouse<target._x?-nR:0;
    target._xscale+=(nS-target._xscale)/5;
    target._yscale+=(nS-target._yscale)/5;
    }
m1_mc.onEnterFrame=function(){
    if (_root.m1_mc.hitTest(_root._xmouse, _root._ymouse, false)){
        myOnEnterFrame(m1_mc,0,150);
        onflag=true;
        }else{
            myOnEnterFrame(m1_mc,5,100);
            onflag=false;
            }
    };
//=======================
//处理鼠标中键事件
mouseListener=new Object();
mouseListener.onMouseWheel=function(delta){
    //trace("delta="+delta+",srollTarget="scrollTarget);
    if(onflag){
    m1_mc._rotation+=delta*5;
    }
    };
Mouse.addListener(mouseListener);

标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}