Reading a text file in ActionScript 3

A problem I and many other Flash developers seem to run into is reading information from a text file. Or more specifically, reading co-ordinates for Sprites, from a text file. It seems that there are many examples of reading a file in ActionScript 3, but not many for reading co-ordinates for sprites, from a text file.

I recently made a level editor that exported sprites that I placed, into a text file. After searching through many posts and forums I found that most people used XML to store this kind of data. But seeing as my text file was quite simple, I really didnt want to use XML and decided that a normal text file was perfect. All the text file has in it is 2 values seperated by a comma. Each value represents the x and the y value for the sprite.
Continue reading