Re: [問題] 使用的movieclip為變數時 要怎麼呼叫쌠…

看板Flash作者 (lol)時間19年前 (2007/01/13 22:46), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/4 (看更多)
※ 引述《achilles03 (achilles)》之銘言: : ※ 引述《gargouille (lol)》之銘言: : : 假設你存回傳值為 target_mc:string : : this[target_mc].swapDepths(100); : : this 可更換為其他的路徑 : 請問 target_mc:string : 是什麼意思? : 我把它理解成 tmp_target="_root."+mc : this[tmp_target].swapDepths(100) : 還是不行 : 是那裡錯了呢? 喔喔,不好意思,講的不清楚 那個就是你 mc 的名字,是個變數,然後型態為string 依照你的需求來看,target_mc是你要控制的mc 的名字 那就會變成: _root[target_mc].swapDepths(100); 換個例子來說好了,假設我今天要控制的是場景上一個叫做"test"的mc: target_mc = "test"; _root[target_mc]._alpha = 10; 這樣就可以把test這個mc的透明度設成10 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.51.69

01/15 18:00, , 1F
謝謝
01/15 18:00, 1F
文章代碼(AID): #15gF2sfD (Flash)
文章代碼(AID): #15gF2sfD (Flash)