Re: [問題] 關於兩個swf之間的資料存取....

看板Flash作者 (隱密忍者農丸)時間17年前 (2009/02/18 16:09), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《sledogerunir (隱密忍者農丸)》之銘言: : 想請教一下,假設現在有兩個swf檔 : 分別為 AA.swf 以及 BB.swf。 BB.swf 匯入到AA裡面 : AA.swf 裡面有個變數為 TT:String = "file"; : 在AS2.0中,BB.swf 如果要抓AA的TT內的數值只要用 : _parent.TT 就可以在BB中得到 "file" 這個字串。 : (以上應該沒錯吧= =") : 不過到AS3.0時,這種做法好像不行使用 : 請問要如何改寫呢? 剛剛自行找資料,找到一些可用的方式,不過不知道是不是正確的作法 PO再這邊給大家評論一番。 這個方法好像是利用stage只會有一個的原理,將檔案丟到stage的timeline 先在AA.swf宣告一個 var TT:String ="Target" 然後BB.swf這邊宣告一個 var c = this.stage.getChildAt(0)//抓到主場景的stage trace(c.TT) 此時匯出BB.swf得到的trace內容應該是undefined 如果將BB.swf匯入到AA.swf內 此時匯出AA.swf得到的trace內容應該就是Target字串 不知道這個方法是不是個好方法???歡迎大家來批判一下XD~ -- Dragon in Underware 3UB Trample. Any man creature become 0/1 weeky chiken. If a woman deal damage to Dragon in Underware, Dragon in Underware become 0/1 weaky chiken. If Dragon in Underware deal damage, put many 1/1 red Ooze token into play -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.32.78
文章代碼(AID): #19cy8bip (Flash)
文章代碼(AID): #19cy8bip (Flash)