Showing posts with label macintosh. Show all posts
Showing posts with label macintosh. Show all posts

Wednesday, May 6, 2009

Macintosh and FileReference Type in Flex

In Mac, the Type attribute of the filereference object returns null by default and this is a huge problem, considering that the type attribute works by default for the PC.


private function getMacExtension(myExtension:String,myName:String):String {
if (myExtension == null) {
if (myName.lastIndexOf(".") > 0) {
myExtension = myName.substr(myName.lastIndexOf("."), myName.length);
myExtension = myExtension.toLowerCase();
}
}
return myExtension;
}