June 17th, 2012, 06:11 AM
Retrieving xml data and matching extension to execute a particular function?
I have an XML file that has location pathways of files to load. eg.
In my movie, if you click a button, it will load file  or  using the XML file to provide the pathway. I am trying to create a script that will look at the extension .mp3 or .swf and depending on the extension, will execute a certain function.
How do I make my movie only look at the last 3 letters of the file text in the XML file??
June 18th, 2012, 08:57 AM
You can use substr on the "file" XML node and check what it returns, in this case the last 4 characters:
var test_filenames:Vector.<String> = new <String>["dog.exe", "cat.exe", "elephant.php", "bird.gif"];
case ".exe" :
case ".php" :
case ".gif" :
Quis custodiet ipsos custodes?
June 18th, 2012, 08:18 PM
Hi Tann, great to read from you!
Thanks for your always helpful replies : )
Originally Posted by Tann San