Flash AS3.0讀取外部文字檔

用actionsctip 3讀取外部文字的方法。

  1. var request:URLRequest=new URLRequest("data.txt");    
  2. var loader:URLLoader = new URLLoader();    
  3. loader.load(request);    
  4. loader.addEventListener(Event.COMPLETE,textLoad); //要加這個才讀的到   
  5.   
  6. function textLoad(e) {   
  7.     loadText.text=loader.data;   
  8. }  

留言