Offer HN: Help with ActionScript 3
Many or most developers I've spoken to have little or no familiarity with ActionScript.
I've spent two years working primarily in ActionScript 3. So if you have any questions about the language, about Flex, about Flash Player/AIR, about best practices, and so forth, I'll try to answer them.
13 comments
[ 2.2 ms ] story [ 36.7 ms ] thread(This is a flash cookies library. My company doesn't use it to invade people's privacy, but I know it could be used for that. If you don't want to contribute to something like that, I'd understand.)
Either way, thanks for the offer!
The Flex references do a pretty good job of documenting what errors are thrown by various library methods. I recommend doing error handling at the first point where an error can be thrown, because AS3's unchecked error system makes it difficult to otherwise ensure that errors don't unintentionally propagate all the way up the stack.
Often, all you will care about is success/failure of a call. That appears to be true in your code. In that case, you might as well Don't Repeat Yourself: just catch(error:Error), and proceed. If you want to record which particular error occurred, you can log error.message or flash.utils.getQualifiedClassName(error). Tangentially, that also futureproofs you against changes to the API like additional Error types that may be thrown.
It's one of those things where you have been stuck for 3 days and are willing to pay someone move on.
Getting started with Flash development is difficult for CS-trained programmers. Most tutorials seem aimed at designers or animators. I haven't seen a good description of the end-to-end tool suite for flash or a list of best practices (e.g., using Flash for animated assets, exporting to a SWC and importing symbols as objects).
And indeed, that also means that many or most of the AS3/Flash resources out there are geared towards the copy-and-paste crowd.
I'd like to do an 'animated prototype' of my app - and Flash is definitely the solution - but it would be nice if someone has already done the basic animations (moving screens, button states, etc).
I've been working on a project of mine, where I need to the webcam to take a photograph of the user. something like chatroulette, but i need users to take only the photo. then send it back to my server where i'll do further processing.
I am an ActionScript noob, so any help in libraries/sample code or approaches that you could offer would be immensly helpful.
Thanks!
For sending the photo, you probably want to look at URLRequest: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl...
A solution might look like this:
1) Set up your server to accept HTTP POST requests which include a photo, in whatever data format you plan to transmit them
2) Obtain the image data from your webcam (I have no particular insight into this)
3) Create a URLRequest
4) Assign the URLRequest's 'url' property as appropriate
5) Assign the URLRequest's 'data' property to to the image data
6) Set the URLRequest's 'method' property to URLRequestMethod.POST
7) Set other URLRequest properties, like ' requestHeaders', as appropriate
8) Add event handlers to the URLRequest as appropriate
9) Call the URLRequest's load()