效果如下:
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);
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);
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}