title: Read a string in AS3
body: <p>I have a question regarding to my project which is how to read a string in AS3. </p>
  
  <p>Actually, I have an text file named test.txt. For instance:</p>
  
  <p>It consists of:
   Sun,Mon,Tue,Wed,Thu,Fri,Sat</p>
  
  <p>and then I want to put all of them into an array and then a string to show them in the dynamic text Box called text_txt:</p>
  
  <pre><code>var myTextLoader:URLLoader = new URLLoader();
  
  myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
  
  function onLoaded(e:Event):void
  {
   var days:Array = e.target.data.split(/\n/);
   var str:String;
   stage.addEventListener(MouseEvent.CLICK, arrayToString);
  
   function arrayToString(e:MouseEvent):void
    {
      for (var i=0; i&lt;days.length; i++)
      {
          str = days.join("");
          text_txt.text = str + "\n" + ";"; //it does not work here
      }
   }
  }
  
  myTextLoader.load(new URLRequest("test.txt"));
  </code></pre>
  
  <p>BUT IT DOES NOT show them in different line and then put a ";" at the end of each line !</p>
  
  <p>I can make it to show them in different line, but I need to put them in different line in txt file and also I still do not get the ";" at the end of each line unless put it in the next file also at the end of each line.</p>
  
  <p>And then I want to read the string and show an object from my library based on each word or line. for example:</p>
  
  <pre><code>//I  do not know how to write it or do we have a function to read a string and devide it to the words after each space or line 
  if (str.string="sun"){
   show(obj01);
  }
  if (str.string="mon"){
   show(obj02);
  }
  </code></pre>
  
  <p>I hope I can get the answer for this question.
  Please inform me if you can not get the concept of the last part. I will try to explain it more until you can help me.
  Thanks in advance </p>