Re: [問題] 影片深度的問題

看板Flash作者時間19年前 (2006/09/30 05:17), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/5 (看更多)
試了一下 不知道這是不是你要的 先設三個元件a_mc, b_mc, mask_mc 一開始設定好他們的深度 之後用onPress與onRelease去改變他的深度: a_mc.swapDepths(0) b_mc.swapDepths(1) mask_mc.swapDepths(2) a_mc.onPress=function(){ this.swapDepths(3) } a_mc.onRelease=function(){ this.swapDepths(0) } b_mc.onPress=function(){ this.swapDepths(3) } b_mc.onRelease=function(){ this.swapDepths(1) } 每個深度都是只能存放一個物件 深度相同 前面設定的消失 如果物件過多難以管理深度的話 用getNextHighestDepth()可以防止這樣的事發生 (MX2004以後的版本才有此項功能): a_mc.swapDepths(getNextHighestDepth()) b_mc.swapDepths(getNextHighestDepth()) mask_mc.swapDepths(getNextHighestDepth()) a_mc.onPress=function(){ this.swapDepths(getNextHighestDepth()) } a_mc.onRelease=function(){ mask_mc.swapDepths(getNextHighestDepth()) } b_mc.onPress=function(){ this.swapDepths(getNextHighestDepth()) } b_mc.onRelease=function(){ mask_mc.swapDepths(getNextHighestDepth()) } ※ 引述《dlan (dlan)》之銘言: : 我用swapDepths(1)和按鈕 on(press) : 去設定影片的深度(好像會使影片跳脫圖層和時間軸的深度) : 但是放開按鈕時 : 要還原影片原本的深度(跳回原本影片所對應的圖層和時間軸的深度) : 用swapDepths(0)也沒辦法 : 有其他的方法嗎?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.112.162.176
文章代碼(AID): #157OrCJQ (Flash)
文章代碼(AID): #157OrCJQ (Flash)