Archive for February, 2008

Flex FlickrFlow 3

I needed a simple Flickr gallery viewer to show user’s photos but I knew I’d seen a couple of cool Papervision based viewers so I decided to search for one.

I found FlickrFlow and downloaded the source code and started hacking my way through it.

First I made the background white and reduced the reflection size, this just required me to fill the bitmap white and create a smaller gradient box for the reflection.

Then I decided it made no sense to use the full size image to show only a smaller one, so I switched to the AS3 Flick API and used the GetSizes API call to get the URL for the “Small” sized image.

This worked and now it is a lot faster than it used to be.

Still, FlickrShow would first fetch all the images and only then start loading then into CoverFlow, so I changed this as well….

Finally, I chose to always select the middle image instead of having a fixed index for selection.

There are still a couple of bugs to fix, mainly regarding mouse click events which sometimes don’t work unless you first use your mouse wheel or keyboard… in the meantime here is a small sample which searches for images with the tag “Madeira Island”.

(The white background doesn’t look good here, I should make it transparent but I have to fix the gradiend before…)

Apache proxy for crossdomain problems 25

Well, the Flash player requires a crossdomain.xml file to reside on every server you call for remote services.

We needed to display RSS feeds for user’s blogs and we couldn’t enforce every single blog provider to have a crossdomain file. The solution was to use a local proxy to perform requests on our behalf.

Common solutions use a server side script to fetch the contents but I didn’t want to have yet another PHP, JAVA, Ruby, etc script laying around so I used Apache’s mod_rewrite with a very simple rule:

RewriteEngine On
RewriteRule ^/my_rss_proxy/(.*) $1 [P]

Since we were already using Apache’s proxies to forward request to my HAProxy I just added this simple rule and now we can use:

http://my_server_url/my_rss_proxy/http://rss_url