Hi,

I have made this simple script that loads log messages from an external text file:

Code:
var myTextLoader:URLLoader = new URLLoader();
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);

function onLoaded(e:Event):void {
track_info.text = e.target.data;

addChild(track_info);
  addEventListener(Event.ENTER_FRAME, scrollField);
}

function scrollField(e:Event):void {
  if(track_info.scrollV < track_info.maxScrollV) {
    track_info.scrollV++;
  }else{
    removeEventListener(Event.ENTER_FRAME, scrollField);
  }
}

myTextLoader.load(new URLRequest("tracks.txt"));

The log file is tracks.txt and has this structure (it can´t be changed because it is autogenerated by a software that gets the mp3 tags from a player in realtime):

Code:
[14-07-2010 20:21:33] Log file created for client.
[14-07-2010 20:21:33] Client connected.
[14-07-2010 20:26:21] * Artist 21 - Song 11
[14-07-2010 20:40:02] * Artist 42 - Song 02
[14-07-2010 20:45:04] * Artist 14 - Song 10
[14-07-2010 20:47:19] * Artist 46 - Song 04
[14-07-2010 20:51:09] * Artist 07 - Song 09
[14-07-2010 20:54:13] * Artist 54 - Song 01
[14-07-2010 20:57:32] * Artist 19 - Song 12
[14-07-2010 21:00:51] * Artist 35 - Song 06
[14-07-2010 21:04:02] * Artist 43 - Song 08

That actionscript allows me to show the last played songs in the flash movie, as I expected. But the issue is that:

1. How can I do to show only the last song (the last line in the text file), which is currently playing?
2. Is there any way to autoupdate the movie to show the current data from the .txt file? I mean, when a new song is playing, the .txt file receives its info into a new line at the bottom (again, the last line is the now playing song).
3. Finally, I would like to remove the "[Day-Month-Year Hour:Min:Sec] *" section of each line (the first 25 characters) and show just the "Artist - Song" part. How can it be done?


Thanks in advance.