Re: [問題] 關於物件與場景的變數

看板Flash作者 (CJ Cat)時間16年前 (2009/05/17 22:28), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
在每個物件上面寫這個就好了 onClipEvent(press) { this.startDrag(); } onClipEvent(release) { this.stopDrag(); } 不需要那個pnum變數 更進階點的,寫一個class,存成AS檔放在FLA同資料夾 class Draggable extends MovieClip { public function Draggable() { this.onPress = function():Void { this.startDrag(); } this.onRelease = function():Void { this.stopDrag(); } } } 然後把要拖曳的元件export for ActionScript 接著把class設為Draggable 所有這個元件的實體就都可以拖曳了 以上code未經過測試,可能有打錯字 -- 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: 61.228.79.219 ※ 編輯: cjcat2266 來自: 61.228.79.219 (05/17 22:30)
文章代碼(AID): #1A41xsvj (Flash)
文章代碼(AID): #1A41xsvj (Flash)