作者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
推 hoHORNrn:謝謝你~~我終於會了^^ 08/04 22:30
推 GODSIZE:推好效能! 08/05 11:56