-
1. Re: File Load is not working on Mac but Windows
wadedwalker Nov 7, 2014 8:58 AM (in response to Maxijin2)I just tried a simple File load test and the type property always traces out null. According to the ASDocs, the type property: "On the Macintosh, this property is the four-character file type, which is only used in Mac OS versions prior to Mac OS X. If the FileReference object was not populated, a call to get the value of this property returns null.".
Further reading into the FileReference docs, all properties are supposed to be populated once the complete event fires and that is when I ran a trace of the File.type.
Since the is an AIR app, you might want to consider using the extension property instead to know the file extension to run a switch case against. The ASDocs also say that in reference to Mac's: "You should consider the creator and type properties to be considered deprecated. They apply to older versions of Mac OS.".
If you choose to use the extension property instead, you don't have to include the "." in your switch statement. The ASDocs do say that "If there is no dot in the filename, the extension is null." So, you may want to run some tests on Windows to make sure that "extension" works. On Mac OS, pretty much every user friendly file (image, movie, document, etc) has a file extension so you shouldn't have any concern of extension returning null on Mac OS.
You probably got the TypeError on Mac OS because you were trying to run a String method on a null object at the start of the switch statement.
-
2. Re: File Load is not working on Mac but Windows
Maxijin2 Nov 7, 2014 3:34 PM (in response to wadedwalker)Thanks Highly Appreciated

