我有這段代碼我試圖在我的FLEX項目中加載一個文件.txt。但有些奇怪的事情發生了,它給了我這個錯誤,但重點是......我使用動態文本代替TextArea在Flash中運行此代碼...並且它運行完美,我開始認爲我有一些問題用我的FLEX軟件...請問有人可以幫助我。1120:未定義的屬性加載器的訪問
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import flash.events.*;
import flash.net.*;
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("external.txt"));
loader.addEventListener(Event.COMPLETE, onComplete);
function onComplete(e:Event):void {
text1.text = e.target.data;
}
]]>
</mx:Script>
<mx:TextArea id="text1" x="209" y="275" width="226.66666" height="208.2738"/>
</mx:Application>
嚴重性和說明路徑資源位置創建時間標識 1120:未定義的屬性裝載機的訪問。 IVSketch/src IVSketch.mxml第10行1261589517158 451 1120:訪問未定義的屬性加載器。 IVSketch/src IVSketch.mxml第11行1261589517159 452 1120:訪問未定義的屬性onComplete。 IVSketch/src IVSketch.mxml行11 1261589517159 453
這些函數中的代碼行? – invertedSpear 2009-12-23 18:26:53
這是一個運行時錯誤還是來自編譯器?錯誤指向哪條線?我很困惑,爲什麼它試圖將onComplete作爲屬性而不是函數。 – tehmou 2009-12-23 18:52:38