So I’ve been working with the Flash guys in the design team at work now for a few months, trying to help them become more effective collaborative Flash developers. It’s not necessarily been the easiest process in the world as there have been a number of concepts that would be straight forward to most regular devs, but not necessarily Flash devs.
Some of the things we’ve gone through are concepts like:
- Using SCM systems to store the code in a central location
- Design Patterns (in particular the MVC and Command Factory seem to get allot of use)
- Multiple simultaneous checkouts of text source files (or “how to develop without individual checkouts”)
- Visually diffing two versions of a source file
And so on. Along the way I’ve actually had to learn a hell of a lot more Action Script than I would have thought I needed to and seen my fair share of Flash ugliness. I’ll probably do a whole series of these little rants, but this week in particular we kept coming across and trying to work around the same infuriating issue.
This has to do with Flash 8 (Action Script 2) and using the FileReference object to perform a multipart form POST to a server, that is, when you try to do a form submission that has a file upload in it and you care about the status of the submit. On most web systems this is probably a common occurrence; “Send us your picture and 25 words why you think you should win the …”. Sounds like a relatively straight forward thing to do in Flash, and in fact it’s not that difficult to code up.
The problem comes when your server tries to process the form upload/submission and send back some information to the Flash client about whether or not the submission succceeded (think form field validation). In theory a file upload is just another http request and the Flash client should have the ability to read the text in the response body. No such luck. It seems that in Flash 8, the FileReference object doesn’t expose the http response body upon completion, I don’t think the Flash architects thought it was useful. What the?
Why go to all the trouble to build a multipart form submission capability inside Flash and then decide not to pass on the response to the Flash client? What possible reason could they have for such a glaring omission of useful information in a standard web-type request/response scenario.
And just for clarity, we have a constant pressure to try and use the minimum version of Flash required to perform our particular task, so while this problem has been fixed in Flash 9, it’s rather annoying to have to change our system to use a whole later version of Flash for functionality that should have been there in the beginning.
Recent Comments