Re: [問題] 使用的movieclip為變數時 要怎麼呼叫쌠…
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 4 篇):
Flash 近期熱門文章
PTT數位生活區 即時熱門文章