Lately I’ve been doing a lot of development in Flash that also involves pulling in and manipulating Flickr photos. The as3flickrlib (http://code.google.com/p/as3flickrlib/) is pretty handy at first glance, but just a fore-warning, there are many things wrong with this library. First off, there is some functionality the Flickr API offers that this library just does NOT offer, for instance, methods to parse information about Collections, or the “farm” attribute of a photo so we know exactly where to grab a thumbnail so Flickr doesn’t have to do any extra work. Also, I’m not too fond of how the structure and usage work, but that’s just personal preference I suppose.
So, getting over the hurdle of inconsistencies in the library, and some hard work, I finally have the finished product. Everything works great! But, when I go to test it online….. BROKEN! This stumped me for a few hours, because looking at the headers coming in and out of the browser was showing that Flash was getting successful API calls, grabbing photos, just not displaying them.
Solution? Even though Flickr will serve up it’s crossdomain.xml, your flash file still doesn’t have access to the Flickr farm servers to pull photos. Whoops! Adding this small snippet below will fix all your problems.
Hey as3flickrlib, maybe you could update your project and throw in these loadPolicyFile calls in there too?
1 2 3 4 5 | Security.loadPolicyFile("http://api.flickr.com/crossdomain.xml"); Security.loadPolicyFile("http://farm1.static.flickr.com/crossdomain.xml"); Security.loadPolicyFile("http://farm2.static.flickr.com/crossdomain.xml"); Security.loadPolicyFile("http://farm3.static.flickr.com/crossdomain.xml"); Security.loadPolicyFile("http://farm4.static.flickr.com/crossdomain.xml"); |



