Infinite Array
  • experiments
  • tutorials
  • projects
  • resources
  • all posts

February 2008 Archives

Smooth Image with Preloader, Drop Shadow, Smart Resizing in Flex

By ryan on February 11, 2008 9:42 PM | Permalink | Comments (1) | digg this | del.icio.us | reddit
By default, the Flex image component does not enable smoothing on scaled images, which makes them appear jagged.  Ben Longoria has written a great SmoothImage class that overrides the image component and sets smoothing to true.  I needed a bit more functionality out of it, so I have extended it a bit further.  I wanted:

  • Smart resizing which scales the image only if it won't fit in the application bounds
  • Drop shadow on the image
  • Centered preloader that displays while image is loading
I have written an updated class that expands upon the original SmoothImage, and includes these new features.
smoothimage.jpg

View the Example

View Source






Here is SmoothImageLoader.as


Yahoo Pipes + Flex Tutorial

By ryan on February 10, 2008 12:19 PM | Permalink | Comments (0) | digg this | del.icio.us | reddit
flexpipes.jpg Yahoo Pipes is a pretty nifty utility for quickly bundling data sources from the web into one neat feed.  While you can do nearly everything Pipes does with ActionScript, the feeds must be cached locally for flash player to access them because of crossdomain policies.  For this reason, it is nice to only have to cache one feed, instead of caching several and then piecing them all together.  This also makes it easy to modify the data feed later on through the Pipes interface without having to touch ActionScript. 


Building a Yahoo Pipes app

pipes.jpgFirst, sign up for a Yahoo Pipes account if you haven't already:  http://pipes.yahoo.com/pipes/
Next, create a simple Application.  There are plenty of examples out there.  You can always clone someone else's pipe, and modify it with your own favorite data sources.  

For this tutorial, I have created an app that pulls feeds from Digg.com, and combines snapshots of the articles from Snap.com
diggsnapshots.jpgThe sample app can be viewed here:
http://pipes.yahoo.com/pipes/pipe.info?_id=xv9z9HSr3BG_6gN48jxBKg


Setting up PHP caching
I am using a PHP RSS caching script called RSS Fetch.  It can be easily customized to cache at specified intervals, or constantly pull the newest data.  I have added a line to the rsslist array for the yahoo pipes RSS source:
"Pipes" => "http://pipes.yahoo.com/pipes/pipe.run?_id=xv9z9HSr3BG_6gN48jxBKg&_render=rss"
You'll also need to create a "cache" directory for the script to write to.  My example can be seen here:
http://infinitearray.com/experiments/feeder/rssfetch.php?id=Pipes&cachetime=5


Creating a Flex App
Luckily, Adobe has done most of the work here.  They've open sourced a few libraries that take care of parsing RSS feeds.   You'll need both the as3corelib and the as3syndicationlib.  Mike Chambers has built a great demo App for working with these libraries.

apppreview.jpg
View the demo

I've built a simple demo application in Flex that pushes the Yahoo Pipes RSS feed into a TileList component.

I've packaged the entire source for this application, including the external libraries. 

View Source

« January 2008 | Main Index | Archives

Search

Subscribe to feed Infinite Array RSS feed

About this Archive

This page is an archive of entries from February 2008 listed from newest to oldest.

January 2008 is the previous archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives

  • February 2008 (2)
  • January 2008 (2)
  • November 2007 (3)
Copyright © 2008 Ryan Robinson
portfolio  |   resume  |   contact