FMS Bandwidth Tester App Works Again

I've just fixed the (now ancient) FMS bandwidth tester. It's based on some pretty old code by Adobe engineer Pritham Shetty and wasn't working since I rebranded the blog - well now it's functional again and I plan to connect it to a new server soon.

The neat thing about this FMS app is that it checks bandwidth both to and from the server - this is very useful if you build RTC based apps that utilise things such as webcam video or live audio.
If right now the speed results seem low then that's probably due to the very old machine I'm using to host the app... Believe it or not, the server is still the same one from back in 2005!

FMS bandwidth tester


Getting Started With node.js

I've been spending a little bit of time with node.js in the last few days and although I have not yet built anything meaningful with it I'm already quite impressed by it - despite it being JavaScript based :-)
In case you don't know what node.js is, let me give you a short intro (if you are familiar with FMS's AS1-based server side syntax then you'll quickly feel at home with node). Combine this with node's event based nature (everything in node runs asynchronously with extensive use of callbacks) and you can see how there is also some similarity with the events you may be used to from ActionScript3.
The fact that node is both asynchronous and single threaded means that every operation it runs is non-blocking, making the platform extremely scalable when it comes to handling large numbers of concurrent requests. LinkedIn for example have apparently had great results porting some of their apps from a Rails backend to node. Reportedly they went 'from running 15 servers with 15 instances (virtual servers) on each physical machine, to just four instances that can handle double the traffic'.

For me at least that sounded interesting, although I have to admit that I do not have any scaling or capacity issues using any other (thread based) server technology so far. Instead what attracts me to node is the similarities both in lamguage and syntax as well as in functionality (node is great for building real-time apps with add-ons such as socket.io).

The most-used example of a simple node.js app is probably this http server from the node.js homepage:

view plain
1var http = require('http');
2http.createServer(function (req, res) {
3 res.writeHead(200, {'Content-Type': 'text/plain'});
4 res.end('Hello World\n');
5}).listen(1337, "127.0.0.1");
6console.log('Server running at http://127.0.0.1:1337/');
It almost requires no explanation at all. Once started it will respond with 'Hello World' to every request. But as I said I have not actually got any code of my own to share right now, but wanted to point you to a great resource for getting started with node which is this page from smashingmag. It has a ton of links to other sites, all containing tips and tricks around node. I found nodebeginner.org particularly useful, but please judge for yourself.

Do you use node? Maybe in combination with a Flash based frontend (I think this would make for a great duo...)? Please leave a comment if you do (but don't hesitate to comment if you don't), and include some demo links if you can.


Multicast Chat Across Devices and Platforms

In preparation for my session at Streaming Media Europe in a couple of weeks I had a play with the IP multicast feature in Flash today. Tom Krcha posted an excellent example on his blog a few months ago which demos this feature very well.
It's worth pointing out that this code works in a LAN setup, not over the public internet. This also means that Cirrus (aka Stratus) is not required for the P2P introduction - Flash Player can handle this itself on a multicast enabled LAN. Therefore you can try this using the devices on your local network, but not with your friends elsewhere on the net.

I wanted to try Tom's example on my iPad and Nexus One. The phone was easy since it can run Flash Player 10.1 and Tom's example app worked fine there. But what about the iPad?
Since I have got an Apple iOS developer account I am able to use the iPhone packaging feature in Flash CS5 to build iPhone and iPad applications. All I needed to do was to port Tom's Flex example to Flash as using the Flex framework on a device is not the best thing to do - at least not until themobile-optimised Hero SDK ships.

This blog post is therefore just a record to say: it worked and it worked well. Porting took only half an hour, and I then spent another half hour fine tuning a few bits and pieces, nothing major. The photo shows the app running on my Windows 7 netbook, the Nexus One and the iPad. I also had it running on my iMac and in the Flash IDE.

Say what you want about Flash on devices, there's something very cool about getting your code to run so easily in so many places. And remember this app now not only spans devices but also platforms and even runtimes since the iPad app is practically AIR based.

You can download my Flash app including sources here, but note that you need an iOS developer account to compile and install it on an iDevice.


Securing Remoting Access To ColdFusion CFCs From Flex

Today I was working on a Flex application which uses a lot of Remoting calls to a bunch of ColdFusion CFC methods. I wondered what the most efficient way of securing these methods would be since they are effectively wide open to the world as they all (have to) specify access="remote". This means that anyone with a web browser can invoke the methods and they will even return nice error messages when certain parameters are missing.
One way of restricting access would be to run all Remoting calls through an intermediate page or CFC which handles authentication and access control and which in turn invokes the (now private) CFC methods. I found this a bit cumbersome and I also knew that there was a better way - I remembered the setCredentials method back from the AS2 days. You can see this described in greater detail by Brandon Purcell in his MAX session Securing Applications from 2003(!), but unfortunately it is not directly usable in today's Flex world.

While Brandon's example is great, and Ray Camden also has some details to add, neither example had all the pieces I needed, particularly an example of not just authenticating a Flex application properly with a CFC but also how to log out again (and to jump ahead, simply running a cflogout tag did not work...).

› Read Full Article


Flickr Image Search using YQL and Flex

A few days ago I spotted a Twitter conversation between Simon Whatley and Christian Heilmann which brought YQL back into my mind. In case you don't know, YQL stands for Yahoo Query Language is 'an expressive SQL-like language that lets you query, filter, and join data across Web services'. In short, it's a sort of API to a lot of other APIs, and then some. It's also very easy to use since it's effectively just like SQL. For example you can use this example query to get details about a specific Vimeo video. But not only can you query web services using YQL, you can even scrape HTML pages which do not expose an API - very powerful stuff.

Flickr is one of the APIs that's also supported and I figured that it would be a great addition to one of my products, Scribblar, if a user could get easy access to all the images for a given keyword which are released under a Creative Commons license. Again this is very easy with YQL using a query such as this one.

I've created a simple Flex app which wraps the functionality provided by YQL and the Flickr API. You can check it out here. The source overview is here, and the downloadable zip here.


Radical Flash Chat - Video Chat Framework

I've just received an interesting email from Jaromir Sivic, a czech developer who sent me news about a project of his called 'Radical Flash Chat'.
While I haven't tried myself yet, Jaromir describes it as a framework that enables PHP and ASP.NET developers to build and manage their own Video Chats, Flash Chats and other multimedia videconferencing applications easily in a very short amount of time. The configuration screen certainly looks quite promising, listing both Wowza and Red5 as a Media server option. There's also an online demo that you can try (that's if it is online, which seems to be fairly intermittent).

I encourage you to try Jaromir's product and share your feedback with him, or indeed below in the comments.

I'm happy to post any news about similar projects or other news items, just drop me an email.


Flex Help Needed - Issues with Image Canvas

This is what happens when you stand on the shoulders of giants - you don't quite know what you are doing, at least in my case.
I've been working on a way to dynamically load images into a Flex app and set them as the tiled background of a Canvas component. Luckily I spotted creacog's work which I adapted a little bit for my needs. You can see the results here.

So far the image loading and displaying as a borderskin of the Canvas works, but as you can see when you drag the box around is that as soon as scrollbars appear the image is no longer rendered and the Canvas's background color it displayed instead.

I'd appreciate any tips on this. You can see the sources by right-clicking the app or directly from here (the .zip is here).

Feel free to use and reuse this code if you find it useful, and remember to credit creacog.co.uk who has done the hard work on this.


My First iPhone Game - Built with Flash!

The time has finally come to lift the lid on this. As you've probably all heard by now, Adobe today announced a brand new feature for the upcoming Flash Professional CS5: Export as iPhone app. Insane! Essentially what this feature will allow you to do is a cross-compilation from SWF to Objective-C - the resulting app is a totally legit iPhone/iPod Touch app which can be submitted to the Apple app Store. In my case that process has already happened, and the app has been approved!

I will post more details about the development process when things have calmed down a little, but for now I'm super exited to announce the immediate availability of my first application for iPhone and iPod Touch: my good old Just Letters game.
I figured this Flash game of mine which stems back from around 2005 would make an ideal candidate for a touch screen device, and I think I haven't been completely wrong with that assumption. Not only is Just Letters one of the first games built in Flash to ever hit the App Store but I have a feeling it is the very first game that use Flash Media Server to provide the real-time features.

In celebration of the launch I am distributing 10 free voucher codes for the US App Store (sorry, the vouchers do not work on App Stores outside the US). The game normally retails for $0.99. Just leave a comment below and I will pick a random 10 later today (leave your email too!).

Please help me spread the word about this game by blogging about it, tweeting or getting your grandma to buy a copy. Don't forget to review and rate it on the App Store too. please point people to the following age when you link to the game: http://www.muchosmedia.com/justletters (muchosmedia is my company, the 'official' developer behind the game).
Last but not least, if you need the game's icon or some screenshots then you can grab a small zip (1MB) from here. It also contains the game description in text format.

Thanks for your support!


My Trials with Flash Lite and FMS

I've had very little experience with Flash Lite to date, but right now I'm working on a project which requires a mobile element to it. Not satisfied with doing the sensible thing and playing it safe I thought it would be great to offer some real-time features on a mobile, either via AFCS or FMS.
So I set out to see what was possible, in particular I wanted to make sure that Remote SharedObjects (RSOs) and NetConnection methods were available in Flash Lite. Here's what I found.

› Read Full Article


Regular Expression to Validate URLs in ActionScript 3

I recently had a requirement for Scribblar (more on that site in another post) to verify if a domain name or page URL entered by a user is valid. Luckily ActionScript 3 features support for Regular Expressions, however my RegExp skills are non existent. So I reached out via Twitter to see if anyone could help. It took all of 10 minutes and a quick session on pastebin for Robert 'Da Man' Hall to sort the problem out for me. In order to preserve this nugget of knowledge for future generations, here it is.

view plain
1var regex:RegExp = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i;

Usage

view plain
1var url:String = "http://www.google.com";
2var regex:RegExp = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i;
3trace(regex.test(url)); // returns true if valid url is found

Thanks Robert!


More Entries