Thanks to Matt Chotin, Violet has added a crossdomain.xml file to their API. So, I went in and removed all the code that was needed for the proxy.
I had the need for a URL Validator for a Flex project, and couldn’t find one. So, here’s the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | package org.iotashan.validators { import mx.validators.ValidationResult; import mx.validators.Validator; public class URLValidator extends Validator { public function URLValidator() { super(); } override protected function doValidation(value:Object):Array { // Clear results Array. var results:Array = []; // Call base class doValidation(). results = super.doValidation(value); // Return if there are errors. if (results.length > 0) return results; // match regex pattern var pattern:RegExp = new RegExp("^http[s]?\:\\/\\/([^\\/]+)\\/"); // run the pattern, but don't error if there is no value and this is not required if (!(!required && !value) && !pattern.exec(String(value))) { results.push(new ValidationResult(true, null, "notURL", "You must enter a valid URL.")); return results; } return results; } } } |
I’m happy to report that three AS3 projects I’m involved in were added to the ActionScript Cloud APIs list. If you’ve worked on any API wrappers or whatnot, be sure to submit yours before MAX!
Sometimes you just need to URL encode a string (URLEncodedFormat() in CF, or urlencode() in PHP), and not actually make a HTTP request. Here’s a simple library for you to use, that I wrote for my OAuth actionscript lib.
Attached is URLEncoding.as for your enjoyment.
Over the weekend, I wrote an actionscript library for client implementations of OAuth. It’s currently untested, but I’d love to see a few people help me keep it up to date & bug free, if anyone’s interested.