flash 怎么才能让一个物体在舞台上移动到鼠标点击的任意位置?希望给个源代码
2个回答
展开全部
import flash.events.MouseEvent;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var myTween1:Tween;
var myTween2:Tween;
stage.addEventListener(MouseEvent.MOUSE_DOWN,MouseDown);
function MouseDown(e:MouseEvent) {
/*trace("ok");
_mc.x = mouseX;
_mc.y = mouseY;*/
myTween1 = new Tween(_mc, "x", Elastic.easeOut, _mc.x, mouseX, 3, true);
myTween2 = new Tween(_mc, "y", Elastic.easeOut, _mc.y, mouseY, 3, true);
}
import fl.transitions.Tween;
import fl.transitions.easing.*;
var myTween1:Tween;
var myTween2:Tween;
stage.addEventListener(MouseEvent.MOUSE_DOWN,MouseDown);
function MouseDown(e:MouseEvent) {
/*trace("ok");
_mc.x = mouseX;
_mc.y = mouseY;*/
myTween1 = new Tween(_mc, "x", Elastic.easeOut, _mc.x, mouseX, 3, true);
myTween2 = new Tween(_mc, "y", Elastic.easeOut, _mc.y, mouseY, 3, true);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询