
June 18th, 2012, 08:57 AM
|
|
Gotta get to the next screen..
|
|
Join Date: Nov 2003
Location: Legion of Dynamic Discord
|
|
You can use substr on the "file" XML node and check what it returns, in this case the last 4 characters:
Code:
var test_filenames:Vector.<String> = new <String>["dog.exe", "cat.exe", "elephant.php", "bird.gif"];
// .exe
trace(test_filenames[0].substr(-4));
// .php
trace(test_filenames[2].substr(-4));
// Execultable
switch (test_filenames[1].substr(-4))
{
case ".exe" :
trace("Execultable");
break;
case ".php" :
trace("PHP file");
break;
case ".gif" :
trace("Image file");
break;
}
__________________
Quis custodiet ipsos custodes?
|