求鼠标控制影片剪辑360度旋转 flash as2.0/as3.0脚本代码
1:求鼠标控制影片剪辑mc360度旋转 代码2:求在场景中有2个按钮如:按钮1,按钮2;点击按钮1影片剪辑mc向左,点击按钮2影片剪辑m...
1:求鼠标控制影片剪辑mc 360度旋转 代码2:求在场景中有2个按钮如:按钮1,按钮2 ;点击按钮1影片剪辑mc向左,点击按钮2影片剪辑mc向右旋转(注:点住按钮影片剪辑mc转动,松开按钮影片剪辑mc停止转动,点击按钮影片剪辑接着转动) 代码求 AS2.0 /as3.0代码都可以~~谢谢各位高手了~~~
展开
3个回答
展开全部
btn.addEventListener(MouseEvent.MOUSE_DOWN,down);
function down(event:MouseEvent):void{
addEventListener(Event.ENTER_FRAME,lft);
btn.addEventListener(MouseEvent.MOUSE_UP,up);
}
function lft(event:Event):void{
mc.rotationY +=2;
}
function up(event:MouseEvent):void{
removeEventListener(Event.ENTER_FRAME,lft);
}
我做了一个按钮的,呵呵
function down(event:MouseEvent):void{
addEventListener(Event.ENTER_FRAME,lft);
btn.addEventListener(MouseEvent.MOUSE_UP,up);
}
function lft(event:Event):void{
mc.rotationY +=2;
}
function up(event:MouseEvent):void{
removeEventListener(Event.ENTER_FRAME,lft);
}
我做了一个按钮的,呵呵
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个是AS2.0的,将影片剪辑拖至舞台,选中影片剪辑打开动作面板,在里面添加代码
onClipEvent(enterFrame){
this._rotation=this._rotation+2; //这里的数字2可以改成你希望的旋转度数
}
onClipEvent(enterFrame){
this._rotation=this._rotation+2; //这里的数字2可以改成你希望的旋转度数
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
as3.0
var speed:Number = 0;
stage.addEventListener(Event.ENTER_FRAME, updataFrame)
btn1.addEventListener(MouseEvent.MOUSE_DOWN, btn1Hander)
btn1.addEventListener(MouseEvent.MOUSE_UP, upHander)
btn2.addEventListener(MouseEvent.MOUSE_DOWN, btn2Hander)
btn2.addEventListener(MouseEvent.MOUSE_UP, upHander)
function updataFrame(e:Event):void
{
mc.rotation += speed;
}
function btn1Hander(e:MouseEvent):void
{
speed = 1;
}
function btn2Hander(e:MouseEvent):void
{
speed = -1;
}
function upHander(e:MouseEvent):void
{
speed = 0;
}
var speed:Number = 0;
stage.addEventListener(Event.ENTER_FRAME, updataFrame)
btn1.addEventListener(MouseEvent.MOUSE_DOWN, btn1Hander)
btn1.addEventListener(MouseEvent.MOUSE_UP, upHander)
btn2.addEventListener(MouseEvent.MOUSE_DOWN, btn2Hander)
btn2.addEventListener(MouseEvent.MOUSE_UP, upHander)
function updataFrame(e:Event):void
{
mc.rotation += speed;
}
function btn1Hander(e:MouseEvent):void
{
speed = 1;
}
function btn2Hander(e:MouseEvent):void
{
speed = -1;
}
function upHander(e:MouseEvent):void
{
speed = 0;
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询