Skip to content

Instantly share code, notes, and snippets.

@hernanBeiza
Created December 30, 2014 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hernanBeiza/6ff39716510573e1ce64 to your computer and use it in GitHub Desktop.
Save hernanBeiza/6ff39716510573e1ce64 to your computer and use it in GitHub Desktop.
AS3 - Obtener Extensión Archivo MAC
public static function extractFileType(fileName:String):String {
var extensionIndex:Number = fileName.lastIndexOf(".");
if (extensionIndex == -1) {
return "";
} else {
return "." + fileName.substr(extensionIndex + 1, fileName.length);
}
}
//Thanks to
//http://www.josh-ho.com/as3-mac-filereference-type-workaround/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment