title: How do i delete text line from a txt file? ActionScript
body: <p>Good morning! So here is basic code, which i get from the "Mobile Development with Adobe Flash Professional CS5.5 and Flash Builder 4.5" tutorial. Pretty much basic code, but those bastards didnt gave any information about DELETE function. THis is my first time application for this, so help is needed!</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
             xmlns:s="library://ns.adobe.com/flex/spark" 
             height="494" creationComplete="readFile()"&gt; 
  &lt;fx:Script&gt; 
  &lt;![CDATA[ 
  
  
  import mx.collections.ArrayCollection; 
  [Bindable] public var todo_items:ArrayCollection;     
  private function readFile():void 
  { 
      var todoFile:File =File.applicationStorageDirectory.resolvePath("todo.txt"); 
  
      if (todoFile.exists) 
      { 
          var fs:FileStream = new FileStream(); 
          fs.open(todoFile, FileMode.READ); 
          var result:String = fs.readUTFBytes(fs.bytesAvailable); 
          var items:Array = result.split("\n"); 
          items.pop(); 
          todo_items = new ArrayCollection(items); 
          fs.close(); 
      } 
      else { trace("Aplication cant find the file"); 
      } 
   } 
      private function writeFile():void 
      { 
          var todoFile:File = File.applicationStorageDirectory.resolvePath("todo.txt"); 
  
  
              var fs:FileStream = new FileStream(); 
              fs.open(todoFile, FileMode.APPEND); 
  
  
              fs.writeUTFBytes(task_txt.text + "\n"); 
  
  
              fs.close(); 
              readFile(); 
      } 
      private function deleteFile():void 
      { 
          //????????????? HEEEEELP         !!!!!!!!!! 
      } 
  
  ]]&gt; 
  &lt;/fx:Script&gt; 
  
  
  &lt;s:List id="todo_list" left="10" right="10" top="146" bottom="87"       dataProvider="{todo_items}"/&gt; 
  &lt;s:Button left="11" right="10" top="69" height="65" label="Save task" click="writeFile()" 
            enabled="{task_txt.text.length &gt; 0}"/&gt; 
  &lt;s:TextInput id="task_txt" left="10" right="10" top="10" height="51" prompt="Specify a task"/&gt; 
  &lt;s:Button left="10" right="10" bottom="14" label="Delete" 
            click="todo_items.removeItemAt(todo_list.selectedIndex); deleteFile()" 
                          enabled="{todo_list.selectedIndex != -1}"/&gt; 
  </code></pre>
  
  <p></p>