Current Position:Home > How to select variable filename from local directory with fn to load xml

How to select variable filename from local directory with fn to load xml

Update:10-11Source: network consolidation
Advertisement
I would like to select a specific xml file to load from a local directory. The file name is composed of “Title” + “number sequence”.  I know the Title (in this case its XLink07), but I need to select the latest number sequence or the latest by date stamp.
For example, the local directory has the following files:
XLink01[36735298100].xml
XLink02[36735298100].xml
XLink02[36735298101].xml
XLink07[36735298100].xml
XLink07[36735298101].xml
In this example I need to select file XLink07[XXXXXXXXXXX].xml where XXXXXXXXXXX is the highest number within the XLink07[XXXXXXXXXXX].xml files.  Title is Xlink07 and function should return Number sequence [36735298101]. Files with higher number sequence have later date stamps than files with lower number sequences. I need to select the highest number or the latest date stamp for the file that begins with XLink07….
My action script to load the local .xml file without any function to select the correct file is:
Security.allowDomain("*", "*")
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("XLink07[36735298101].xml"));
xmlLoader.addEventListener(Event.COMPLETE, showXML);
function showXML(e:Event):void {
XML.ignoreWhitespace = true;
var Innards:XML = new XML(e.target.data);
tweet_name.text = Innards.XLink01[0].screen_name;
tweet_1.text = Innards.XLink01[0].text;
tweet_date.text = Innards.XLink01[0].created_at;
Thanks for the help if anyone can script that function for me if its possible.

The Best Answer

Advertisement
If you develop for Flash browser plugin (not AIR), there is no way to read directories.