« Popular Flickr Tags | Main | What the heck is this? »

Flickr Flash interface in blog posting.

As you can see in the two previous entries, my latest experiment is a success.
The purpose is to allow someone to host their audio and text on a blog, images on Flickr, and have the Flash movie controlled by the rss.

Here's what's going on behind the scenes.
A spoken word mp3 is uploaded to the entry and is enclosed. The text of the mp3 is placed in the entry body.
The flash movie object/embed tag is added to the entry body. The flashVar in the tag tells the movie the title of the entry it is supposed to read.
When the movie initializes it reads atom.xml using an absolute path (so it works when reading a single entry which has a different path from the main view). It finds the entry with a matching title then extracts the text from the entry body. The url of the mp3 is also found and is used to load the audio track into the player.
When you hit play it starts the mp3 and begins spooling out words from the text proportional to the soundObject.position. At random intervals a word is sent as a tag to flickr and ten image results are returned based on the tag. One of the images is selected and displayed in the movie.
There are a few problems remaining. If you try to use the movie outside of blog.lib.umn.edu the cross-domain policy prevents the rss from being read. I did play around with using an XMLhttpRequest and was able to get the rss into javascript on a remote server. I could parse it in javaScript then pass it to the Flash movie. I also wanted to have the waveform of the mp3 display as a timeline, but I can only do that in Action Script 3. Everything is possible, but I don't want to refactor the whole deal until there is a good reason to do it.
If you would like a copy of the source files, email schub019@umn.edu.