Flickr: Now Even More Flash-friendly

Posted in "Web APIs" at 7:00 am on August 29, 2007 by Allen Rabinovich |

As you are all surely well-aware, Flickr is one of Yahoo!’s most Flash-friendly properties. And how could it not be? With a crossdomain-enabled API and a thorough AS3 wrapper available from Adobe, Flickr-based RIAs are a joy to develop. But today, our good friends at Flickr lent us a helping hand yet again, and added a liberal crossdomain file to their photo servers. The new crossdomain.xml file (located at http://static.flickr.com/crossdomain.xml) now gives all of your Flash apps full access to a whole universe of photographic goodness. And by full access we mean “really-really full”, with BitmapData readily acessible for every single photo.

And what does that actually mean? Well, just to whet your appetite, it means that you can now import photos from Flickr as actual Bitmaps, rather than generic DisplayObjects, and as such, you can make all the visual transforms anti-aliased by setting Bitmap’s smoothing property to true. In the example below, we load the same image from Flickr twice: on the left, it’s presented as a Bitmap, with smoothing turned on. On the right, it’s shown as a DisplayObject (as it would be if there weren’t a crossdomain.xml file). Now try pressing the button to make the images spin.

Please install Flash 9 to see this example.


Rotation is a pretty simple transform, but can you see the remarkable difference? The image on the right looks like there are ants crawling all over it, whereas the image on the left is stoic and smooth, like a Spartan. This will also hold true for all other transforms, both simple (scaling, transposing, etc.) and complex.

The fun, of course, doesn’t end here. With access to BitmapData, you can efficiently crop the images you load, make fast bitmap collages, analyze image’s colors and edges, perhaps even do clever visual transformations (an “AndyWarholizer”, anyone? We’ll feature it if you build it!)—the possibilities are really making our heads spin like the images above. So please, go out, build Flickr-based apps, let us know about it and make us proud. But of course, when you do, kindly remember to observe Flickr’s Terms of Service, which among other things, ask you (quite nicely) to link all images you load back to their original Flickr pages.

Share: on Yahoo! My Web | on del.icio.us | digg it! | reddit!

31 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Can’t wait to fool around with some pixel manipulation. Also, no example that I can see?

    Comment by Myles — August 29, 2007 #

  2. […] proxies! They added an open crossdomain file on http://static.flickr.com. Fuck yeah! Read the blog post here. You can see the crossdomain file here: http://static.flickr.com/crossdomain.xml. Thank GOD. I no […]

    Pingback by dougmccune.com » Blog Archive » Yes!! Thank you Flickr for crossdomain.xml — August 29, 2007 #

  3. Sounds very cool, but I’m not seeing the example you talk about.

    Comment by blackant — August 29, 2007 #

  4. […] More details can be found on the Yahoo! Flash Blog. […]

    Pingback by jonnymac blog » Flickr Adds crossdomain.xml to Image Server — August 29, 2007 #

  5. […] More information at Yahoo! Flash(R) Blog […]

    Pingback by Uza’s Blog & More » Blog Archive » Flickr Opens Crossdomain.xml — August 29, 2007 #

  6. Yay - go Flickr!! One note - this solution does not work with Flash 8/AS2.

    Comment by felix — August 29, 2007 #

  7. Sounds very cool, but I’m not seeing the example you talk about.

    Hey — sorry about that, we are still ironing out some glitches in our blog. The example should now be visible :)

    Comment by Allen Rabinovich — August 29, 2007 #

  8. This is excellent news. Thanks a lot - this will save me a lot of traffic in my mashups!

    Comment by Mario Klingemann — August 29, 2007 #

  9. scratch one more off my list of things that have driven me crazy… thx -s (still far from sane :))

    Comment by Steven Gemmen — August 29, 2007 #

  10. Any chances of posting the source, pretty please?

    Comment by Jim Ray — August 29, 2007 #

  11. Good news, thanks to Yahoo flash folk for pushing stuff like this. How about the same thing for the map tiles in Yahoo’s maps API?

    Comment by Tom Carden — August 29, 2007 #

  12. Wow, this is great news. There will be more flickr based flash applications.

    Comment by Han Sanghun — August 29, 2007 #

  13. […] via Flickr: Now Even More Flash-friendly […]

    Pingback by Hangun’s World - Blog » Blog Archive » Flickr opens up for Flash — August 29, 2007 #

  14. I’m still having issues with the http://farm2.static.flickr.com/, anyone else seeing problems?

    Comment by Todd — August 30, 2007 #

  15. […] Yahoo/flickr’s great move to implement crossdomain.xml on their flickr image servers, check it out. […]

    Pingback by Playfool® - Darren Richardson » Blog Archive » Flickr: Now Even More Flash-friendly — August 30, 2007 #

  16. I’m still having issues with the http://farm2.static.flickr.com/, anyone else seeing problems?

    Hi Todd,

    http://farm2.static.flickr.com/crossdomain.xml is there, so it should be all right. One note though: make sure to specifically set checkPolicyFile flag to true when you instantiate your loader. It’s false by default, so Flash doesn’t check it. You’ll want to do something like this:

    var loader:Loader = new Loader();
    var context:LoaderContext = new LoaderContext();
    context.checkPolicyFile = true;
    loader.load(URLRequestToFlickr, context);

    If you do that, the loader.content will actually point to the Bitmap type loaded from Flickr (if you don’t, loader will just point to DisplayObject and loader.content won’t be accessible.)

    Comment by Allen Rabinovich — August 30, 2007 #

  17. Hi Allen, thanks for posting that…

    I’m trying something similar, but it’s not working. I”m trying to use the loaderContext of the Image Control:

    var daImage:Image = new Image();
    var lc:LoaderContext = new LoaderContext();
    lc.checkPolicyFile = true;
    daImage.loaderContext = lc;
    daImage.load(”http://farm2.static….

    and I’m still ending up with the same error. Anyway to try your code sample with the loader built into the image?

    Comment by Todd — August 30, 2007 #

  18. […] opens up to even more flashy crossdomain scripting with new crossdomain.xml file […]

    Pingback by about: things » Blog Archive » tumbling along the lines of anarchaia.org — August 31, 2007 #

  19. Well done! It works.

    Comment by Dan — August 31, 2007 #

  20. […] in time! flickr implemented a crossdomain.xml on their flickr image servers. This finally allows to use the BitmapData.draw() command with images downloaded from flickr.com […]

    Pingback by jodybrewster.net::blog » Blog Archive » Flickr adds policy file — September 6, 2007 #

  21. […] 請見此文章 Yahoo!Flickr 打開crossdomain的限制了,以後你用Actionscript取回來的result物件可以直接轉成Bitmap物件;而非以往的DisplayObject了。 簡單說,收回來的物件,真的是堆像素了,能作的處理也更多了! […]

    Pingback by 小薛部落格 » Blog Archive » Yahoo!Flickr全面開放Actionscript存取! — September 7, 2007 #

  22. Good news, thanks to Yahoo flash folk for pushing stuff like this. How about the same thing for the map tiles in Yahoo’s maps API?

    Comment by Tom Carden — August 29, 2007 #

    Yea, I just ran into the map tiles issue because of lack of a crossdomain.xml myself. I really wish they would add a crossdomain.xml for those map tiles. All I want to do is put my map in a viewstack and wipe the map in….

    Comment by Omar Gonzalez — September 13, 2007 #

  23. […] Flickr: Now Even More Flash-friendly // Goodbye Image Proxy - Thank You […]

    Pingback by Flickr Connect at Mon555.blog — October 13, 2007 #

  24. Hi Yahoo Flex team!
    I agree with Omar and Tom. it would really be great if you folks offer it on your main site.

    Comment by John — December 27, 2007 #

  25. […] able to load Flickr images into a 3D engine was recently made possible when Flickr added crossdomain XMLs to it’s image servers. Thanks […]

    Pingback by Flickr 3D Tiltviewer! | zedomax.com - a blog about DIYs, hacks(wii hacks, iphone hacks), and satiric opinions on gadgets and technology today. — January 22, 2008 #

  26. It works flawlessly. Great work! Well done! Thanks.

    Comment by plastik — January 30, 2008 #

  27. “On the right, it’s shown as a DisplayObject (as it would be if there weren’t a crossdomain.xml file)”
    Have you got the AS3 code for this as I want to load images from picasa and other sites that don’t have crossdomain files… BTW what about videos such as youtube? Thanks

    Comment by t — February 5, 2008 #

  28. […] More information at Yahoo! Flash(R) Blog […]

    Pingback by Flickr Opens Crossdomain.xml — February 13, 2008 #

  29. […] able to load Flickr images into a 3D engine was recently made possible when Flickr added crossdomain XMLs to it’s image servers. Thanks […]

    Pingback by TiltViewer - A 3D Flickr Image Browser — February 24, 2008 #

  30. Awesome. Thanks so much for pointing it out. I really needed this.

    Since there at the moment seems to be only 4 farms at flickr, you can just put the following in the beginning of your code:

    System.security.loadPolicyFile(”http://farm1.static.flickr.com/crossdomain.xml”);
    System.security.loadPolicyFile(”http://farm2.static.flickr.com/crossdomain.xml”);
    System.security.loadPolicyFile(”http://farm3.static.flickr.com/crossdomain.xml”);
    System.security.loadPolicyFile(”http://farm4.static.flickr.com/crossdomain.xml”);

    And then you can load the pictures afterwards in any way you want, and be able to use draw and whatever.

    Comment by Jesper — February 29, 2008 #

  31. […] More details can be found on the Yahoo! Flash Blog. […]

    Comment by katarzyna cichopek — March 6, 2008 #

Leave a comment

Note: Comments are moderated for first-timers. Spam deleted.

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Hosted by Yahoo!

Copyright © 2007 Yahoo! Inc. All rights reserved. Privacy Policy - Terms of Service

Powered by WordPress on Yahoo! Web Hosting.