Re: [問題]AS3 改變游標
※ 引述《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
推
08/04 22:30, , 1F
08/04 22:30, 1F
推
08/05 11:56, , 2F
08/05 11:56, 2F
討論串 (同標題文章)
Flash 近期熱門文章
PTT數位生活區 即時熱門文章