看板 Flash 關於我們 聯絡資訊
你的需求只要把 load 跟 unload 的工作交給 00.swf 就好了 在 00.swf 的 Index.as 檔新增: private var _ldr2:Loader = new Loader(); private var _file2:String = "02.swf"; public function release01():void { // 卸載 01.swf _ldr.unload(); // 載入 02.swf _ldr2.load(new URLRequest(_file2)); this.addChild(_ldr2); } 並在 01.swf 的 first.as 修改: function GoTo_02(e:MouseEvent):void { // button 按下後的動作 // 讓他呼叫 00.swf 的 function 就可以了 Object(this.parent.parent).release01(); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.121.201.241
a0801284545:謝謝你~~ 我試試看 05/16 17:18
a0801284545:在FLAS中執行00.FLA 點按鈕出現 05/16 17:53
a0801284545:flash.display.Loader 上找不到屬性 release01 05/16 17:54
a0801284545:代表01沒抓到00的function嗎? 05/16 17:54
jeaby:你有加修飾詞 public 嗎 05/16 17:57
a0801284545:成功了^0^ 原來是因為我01.swf有兩個場景 05/16 17:58
a0801284545:變成要this.parent.parent.parent 多一次 XD 05/16 17:59
a0801284545:我不知道是不是這個原因\ 但是多一次.parent成功了 05/16 18:00
a0801284545:可是場景跟舞台沒關係吧 一個swf不是只有一個stage? 05/16 18:01
a0801284545:不過還是謝謝你的回答!! 05/16 18:03
不好意思我弄錯了... function GoTo_02(e:MouseEvent):void { /* 假設 button 是直接加在 01.swf, this 是 01.swf (我以為是 button..) this.parnet 是 00.swf 的 _ldr,"不"是 01.swf this.parent.parent 是 00.swf */ } 我不知道你這邊指的場景是什麼 不過一個 swf 只有一個 stage 是對的 而且很多個 swf 在一起,也還是只有一個 stage ※ 編輯: jeaby 來自: 122.121.201.241 (05/16 18:30)