作者:
nash777 (nash777)
2013-08-08 15:34:57如標題
我在主場景上 套用了Main.as
然後在這個class內 寫了一個function
譬如
public function test(){
trace ('testing');
}
我在場景新增一個mc 套用一個mc.as
在此class內寫
public var aaa:Main = new Main();
在這個步驟執行就會報錯
如以下
Error: Error #2136: SWF 檔案 file:///C|/Users/Desktop/test/test.swf 包含
無效的資料。
at Mc()
at mc()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at Main()
這是錯在哪呢?
會這麼做的原因是想A.as呼叫B.as內的function和變數
我試過如果不是套用主場景的情形下就可以正常使用
是否我要把我的邏輯的函式移出 套用主場景的Main.as?
煩請前輩們指導
謝謝