It was really actually a great project in that small and focused enough to be very manageable and I’d been looking for an excuse to play with it, but I’m not a graphics guy so I haven’t really had the opportunity to ever use it.
So, what I ended up doing was grabbing a file upload widget from FlahsDen ( http://flashden.net/item/upload-gadget/12202 ) It’s a fine widget and you get the source code. This particular component is made with the intent that it be embedded within a Flash based application. It’s quite configurable and had it up and working within a few hours of playing with it. Pretty good documentation to boot!
I embedded it within a very simple Flash data entry fields. The flow is, you fill out the form and the upload widget becomes usable and you upload the file. The page that accepts the incoming file and it’s accompanying form data then inserts the image as a binary blob in the DB and the values are inserted into the database as well.
When all is said and done it looks much like this (click for larger image):
Once I got over the learning curve of Adobe Flash CS4, coding was nice. I used a programmatic event driven approach and it worked out really well. I was expecting a much more difficult time when I went to try sending the form data and the file upload which the purchased widget does via a FileReference. But it worked just like I wanted it to. Unfortunately the FileReference.Upload call throws away any http headers you may want to provide. I didn’t need that but ya never know.
Another interesting thing I found was that the combo box controls don’t initialize their selected index. I don’t know why I expected a fat 0 (zero) but it’s –1. I understand the ability to notice the default state’s value Vs.. a selected one, but for some reason that stuck with me.
In retrospect, the only thing I would have done differently was to make the form portion, straight asp.net dynamic html and disabled the flash uploader when the form wasn’t valid. Form values on the page are sent for the ride so I would never had to broker the user provided fields into the uploader to ride on it’s FileReference request.
At any rate, I’m left feeling intrigued and somewhat excited. I would like to work on some animation coding and perhaps pursue some more “real” custom flash based applications for clients.
I really wanted to hate it, and *hangs head in shame* kinda <3 it 😮