Adobe Flash, Flex and Air

Scoop – a new Feed RSS Reader for Mac, Windows and Linux – synchronizes with Google Reader

28.10.2008 0

Scoop is a new piece of software I’ve been developing in my spare time with Adobe Flex Builder and AIR. It’s really starting to take shape and I’m hoping to be in a position to release the first beta version within the next couple of weeks.

For anyone not familiar with RSS Feed Reader’s in summary they allow you to subscribe to multiple RSS news/blog feeds which you’ll find on tonnes and tonnes of websites and blogs in cyberspace. So, every time one of these websites posts a new story on their site the story or summary gets added to their site/page RSS feed – text, images and other media can also come through the feed.

You’ll see links to these RSS feeds on almost all the blog front pages out there and also on many information sites, whatever your interest – News sites, Sports sites, Celebrity Gossip sites etc etc

There’s a great browser based application called Google Reader which enables any google account holder (if you don’t have one already sign up for free here) to easily add any RSS feed to their Google Reader account and keeps track of all your subscribed feeds enabling you to quickly scan the latest scoops of your favorite sites every time you log into Google Reader.

Scoop will enable users with or without Google Reader accounts to keep track of their favorite sites directly from the Desktop. It will also synchronize with your Google Reader account so any story you read in Scoop will update Google Reader’s read items, any feed you add or remove will also update with Google and vice verse.

But there are added benefits to Scoop that a web browser can’t offer, here are just a few:

  • Scoop will offer alerts so that you never miss a breaking story
  • Scoop will cache all the stories it downloads enabling you to read them on the train when you don’t have an internet connection plus will will auto update google the next time you do connect to the net
  • Scoop is super quick – no waiting around for stories to download (it’s already cached them locally!)
  • Scoop enables you to enter multiple profiles/settings. This means that it can synchronize with multiple Google accounts (optional). I think this provides a great way to segregate different main interests. Ie, I’ve got an account which keeps track of my favorite Flash/Flex blogs but I’ve also set another one up to keep track of my favorite news feeds. The Alerts feature of Scoop is going to enable you to set the alert frequency and colour code different Scoop profiles so that you can quickly register the type of new Scoop update.

Anyway, here are a couple of screen grabs of the current development version which is not quite ready for public download but will be very soon – why not subscibe to this blog feed or the Scoop specific blog I’ve set up so you’ll know as soon as it does go public?

Scoop Profile settings window - enables users to add multiple rss reader accounts

Scoop Profile settings window – enables users to add multiple rss reader accounts

Scoop quickly syncronizes with my Google Reader account

Scoop quickly syncronizes with my Google Reader account

As soon as I select a feed from the tree list the stories associated with that feed are loaded into the reading panel

As soon as I select a feed from the tree list the stories associated with that feed are loaded into the reading panel

BTW – I’m no designer – so if there are any good designers our there interested in contributing to this project and designing a cool Flex skin for the application I’d love to hear from you!

New Flex/AIR component: keep track of your user’s Internet connection status

23.10.2008 0

A simple but very useful component for developing AIR applications that need to know whether the user is connected to the internet or not. Choose a reliable url as your sourceURL for the component. Then the InternetConnectionStatus component will monitor that url and keep your application informed about the internet connection status via it’s connected bindable property!

Download the example

Download the AIR application installer

Nick Kuh Open Source Component Library

23.10.2008 0

From now on any useful Adobe Flex or AIR code example or component will be available to download from my new Google Code Repository.

If you checkout the svn repository straight into Flex you should see it automatically build a Flex Library for you, including the swc file that contains all the source.

Hope you find them useful!

Auto centre main AIR Application window with code

17.10.2008 1

Here’s a tip for how to centre (center for you yanks) your main Adobe AIR application window at runtime. It’s not as obvious as this.x = numX, this.y = numY for some reason. All this does is ends up moving you application container out of the NativeWindow masked view. Not what I was after.

You can set the initial position of your main application window in your app descriptor xml (although I can’t see the point of this as most developers are going to want it set dynamically based on the dimensions of the user’s screen).

So here’s the code that get’s called once the windowComplete handler is called:

private function centreApp():void
{
var screenBounds:Rectangle = Screen.mainScreen.visibleBounds;
var w:int = width;
var h:int = height;

var x:int = screenBounds.x + ((screenBounds.width-w)/2);
var y:int = screenBounds.y + ((screenBounds.height-h)/2);
stage.nativeWindow.x = x;
stage.nativeWindow.y = y;
visible = true;
}

In the main application I’m building I’m using the PureMVC Flex Framework and I’m not actually running this code snippet until my config xml and my styles swf has completed load into the main application so my code retains full control of when the application displays and where it displays :-)

Download the App

Download the Source

Regular Expressions in Flex and AS3

16.10.2008 1

I’ve needed to user Regular Expressions a couple of times since they were introduced in ActionScript 3 and invariably find myself trawling the Regular Expression tutorial/example websites out there which in general I find very confusing! I don’t think Regular Expressions are that difficult to grasp (the basic anyway) but none of the example sites I’ve found have clear explanations of the syntax.

I’m currently developing a Crossword Application in Flex for a client which is pretty much complete. However, one of the bugs I had to resolve today was being caused by some unforseen incompatibility issues with the solution text node coming from the client’s huge database of crosswords xml files. If a solution for example had a space, apostrophe, hypen or various other punctionation it needed to be stripped out of the node by my code to ensure that the correct number of cells were generated on my crossword app grid. So here’s an example of using a regular expression to do just that:

var notCharOrNum:RegExp = /[^A-Za-z0-9]/gi;
var myText:String = "The bee’s knees";
myText = myText.replace(notCharOrNum,""); //outputs “Thebeesknees”
trace(myText);

In summary the reg expression means match everything that isn’t either a letter or a number. The ^ bit is the special character than means except these characters. The g means global – I think that just means the match continues searching throughout the string until it reaches the end. The i means case insensitive search so I guess this would do the same thing:

var notCharOrNum:RegExp = /[^a-z0-9]/gi;
var myText:String = "The bee’s knees";
myText = myText.replace(notCharOrNum,""); //outputs “Thebeesknees”
trace(myText);

Yep – just checked and it does!