Title: Losing File reference in Notification body?? Post by: shizny on March 09, 2008, 06:17:11 I have a mediator for a form that sends a notification (body of note is event.target which is a file that has been selected) out to a command, the command relays the info to a proxy, and the proxy delegates loading of file and then returns a notification. I keep on getting this error that says
TypeError: Error #2007: Parameter file must be non-null. at flash.filesystem::FileStream/open() I'm tracing out the note.body(), throughout the process and it is good until I actually try and open the file. Am I not casting things in the right manner, not passing info in the notification correctly? Here are little snippets of the process. In the mediator public function fileSelected(event:Event):void { In the command override public function execute( note:INotification ) :void the proxy public function loadFile(event:Object):void and finally the helper where I'm getting the error. public function loadGSISFile(event:Object) : void Does anybody know what I'm doing wrong. Title: Re: Losing File reference in Notification body?? Post by: tobydeh on March 10, 2008, 03:44:26 How and what was the "fileSelected" method listening to?
Title: Re: Losing File reference in Notification body?? Post by: shizny on March 10, 2008, 07:25:11 It is listening to the event.select here...
getImportNewGameData.browseGood = true; Title: Re: Losing File reference in Notification body?? Post by: tobydeh on March 10, 2008, 08:10:49 You are passing an array, not the File() Object..
sendNotification( ApplicationFacade.IMPORT_FILE_SELECTED, event.target ); NOT sendNotification( ApplicationFacade.IMPORT_FILE_SELECTED, [ event.target ] ); otherwise you would have to use note.getBody()[0] Title: Re: Losing File reference in Notification body?? Post by: shizny on March 10, 2008, 08:20:59 oops, that was stupid. Thank you.
|