Thanks to the readers’ comments I got it working. Yippee!!! I just did an OS software update going from OS 10.5 => 10.5.1. I did uninstall the flash player and then reinstalled it but that may be entirely unnecessary as the OS update may completely address the fix for the older flash player versions. That is my assumption.
My buddy just sent me a link to folks reporting this issue all over the place. So the code wasn’t an issue, the OS is. Adobe has released n update to the mac version of the Flash player:
I wanted to throw this out there. I have been trying to get a LocalFileUtil class to work for a day or so with no luck whatsoever. I have given the code to another developer running a Mac with OS 10.4.10 and was tested in both Firefox and Safari. It works as expected. So why no go for me?Basically what is happening is this: I have created a simple example application that should only trigger either the Event.SELECT or Event.CANCEL handlers. Regardless if I actually select or cancel, the Event.CANCEL handler is triggered. When inspecting this in the debugger, I find that there are some issues introspecting the fileReference var. Specifically when looking at the event.target (which happens to be the fileReference) I cannot view the properties. Instead of saying actual properties it says, “<exception thrown by getter>”. Looking into that further I find the following exception, “Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful”. Now this is the same kind of exception that is triggered when using one-time use classes such as an instance of Sound. Sound is the type of class that can only be used once. Even if none of the parameters change, you cannot use that same instance. Its a throw away. Anyway, I have no clue as to what the issue is. Any input is much appreciated. Below is the sample code and a screen shot.
<?xml version="1.0" encoding="utf-8"?>
public var fr:FileReference
public function onClick ():void
fr = new FileReference();
fr.addEventListener(Event.SELECT, onSelect, false);
fr.addEventListener(Event.CANCEL, onCancel, false);
fr.browse([new FileFilter("images", "*.png;*.jpg;*.gif")]);
public function onSelect (evt:Event):void
public function onCancel (evt:Event):void
<mx:Button label="test" click="onClick()"/>