作者cjcat2266 (CJ Cat)
看板Flash
标题Re: [问题]AS3 改变游标
时间Mon Aug 4 21:36:36 2008
※ 引述《hoHORNrn (HORN)》之铭言:
: 如果现在我要用AS3来做的话
: 不知道startDrag那个要怎麽改才能让他顺利的执行呢?
我都是这样做
Mouse.hide(); //隐藏滑鼠
cursor_mc.mouseEnabled = false; //关掉滑鼠触发事件
cursor_mc.mouseChildren = false; //关掉children的滑鼠触发事件
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);
function moveCursor(e:MouseEvent):void {
cursor_mc.x = cursor_mc.parent.mouseX;
cursor_mc.y = cursor_mc.parent.mouseY;
e.updateAfterEvent(); //不理会frame rate,以最高速率更新位置
}
这样的写法应该是跑起来最顺畅的
startDarg()有frame rate的限制
而updateAfterEvent()则没有
--
CJ Cat = Croa'J Cat = Cockroach Cat = 西街凯特 = 蜚蠊猫 = 蟑螂猫
Blog
http://cjcat.blogspot.com
Gallery
http://cjcat2266.deviantart.com
ptt2 Board CJWorkshop - 阿多比闪光(Adobe Flash)研讨区
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.202.223.3
1F:推 hoHORNrn:谢谢你~~我终於会了^^ 08/04 22:30
2F:推 GODSIZE:推好效能! 08/05 11:56