You’d think there would be a straight forward way to htmlEncode and htmlDecode strings in flash but there doesn’t seam to be any sort of built-in utility class that supports this. Oddly enough there isn’t one in Javascript either. Like this Javascript hack, here is a handy hack to pimp AS3’s native XML object instance to do the htmlEncoding/decoding for you.
Unfortunately this doesn’t work for many encoded characters like “í”, “ó”, “á”, and “ñ”. It seams the best route to robust html html encoding/decoding is to roll your own utility function like this.
Eugene has a handy MultipartURLLoader class to do the leg work of sending multipart form data from flash.
Note that because it uses:
urlRequest.requestHeaders.push( new URLRequestHeader( ‘Cache-Control’, ‘no-cache’ ) );
You may get SecurityError:
Error #2044: Unhandled securityError:. text=Error #2170: Security sandbox violation: http://domain1.com/your.swf cannot send HTTP headers to http://domain2.com/yourscript.php.
You may need to add a variation of <allow-http-request-headers-from domain=”*” headers=”*”/> to your crossdomain.xml file or comment out that line. I chose the latter as I don’t think its neccessary in a POST call.
Thanks be to Google and this blog I finally tracked down the cause of a mysterious unsightly rectangular white flicker that occurs when clicking on buttons in some of my projects as of late. The culprit? Mac Firefox 3 + SWFAddress. Its really an ExternalInterface+Firefox 3 issue but a recent SWFAddress 2.2 release fixes it!
-Build-in fix for the Firefox 3/Mac OSX blinking effect.
I’ve been using a Mackbook Pro almost exclusively for development for the last 2+ years and really enjoy it. Adium is by far the best AIM client on any OS and QuickSilver makes interacting with the OS super quick. There are a few weird UI decisions though that irk me on a daily basis though and I finally google’d one for a quick fix. Here’s a quick Terminal command to show full folder paths in Finder folder windows. Now if I could only cut-and-paste in the file system and edit/delete/manage files in file browser dialogue boxes I’d be all set.