December, 2009


22
Dec 09

Less spaghetti, more source please

I’m a firm believer in stability.

Build it, test it thoroughly, and move on to the next piece of the puzzle. If the pieces are stable, they’ll work in harmony together, and you can build more powerful applications.

Which is where design patterns, and particular, MVC come into their own.

As a Flash developer it’s nice to know that many of the problems I’m trying to solve have been thought about and cracked a long time before Moock taught me how to code (thank you Colin, and your amazing O’Reilly books).

I’d been using a version of MVC that I’d cribbed from the back of Essential ActionScript 2.0 back in 2004, and had even ported it to ActionScript 3.0 as soon as I made the switch, using the new event model. It was pretty rough around the edges, but hey, it had become my baby now. It worked, and I was kind of proud of myself.

Then this year I made the leap of faith of switching to PureMVC, a framework for ActionScript development that was so popular it had started being ported to other languages such as Ruby, Objective C, etc. If it’s that popular, it must be good, right?

Is there a learning curve? You betcha. Is it worth it? I’m sure of it.

What is MVC?

PureMVC structure

See - it's simple.

It stands for Model-View-Controller, and is, IMHO, perfectly suited to the bear-trap that developing in Flash can quickly become.

At its simplest, MVC separates the state of an application (the model) from the display (the view). The controller takes input from the view, updates the model, and then broadcasts a notification that a change has happened. The views are then updated with the new state.

While it can seem like a long-winded way of developing, its structure encourages good development practices, helps avoid spaghetti code, and leads to more modular, reusable classes.

PureMVC has been a learning curve for both Shane and myself. However, the benefits it brings in stability and re-usability make it very, very worthwhile, and I’d recommended it to anyone bulding anything more complex than a banner.

But please don’t ask me to listen to Coldplay.


21
Dec 09

Off to the (reindeer) races…

So it’s finally live. Introducing the Mason Zimbler Christmas spectacular… ‘Racing Reindeer’. We’ve given you £1000 (virtual) pounds to have a flutter at our reindeer races. Customise your avatar, place your bets and play against your friends in real-time. Get on over to http://racingreindeer.mzl.com and join in the festive fun!

It’s been a massive collaborative effort from the whole studio this one, pretty much everybody’s had a hand in this one at some stage and it’s been a massive learning experience. The Christmas card is traditionally something we get a little more freedom on to try out some new things and push ourselves a bit but this year really takes the cake.

Russ and I have been hammering the ActionScript to get this all working in time for Christmas so we’ll be posting a few run-downs on the new and cool stuff we used in the New Year. Here’s a brief taster of some of the stuff we’ve been playing with and will hopefully get some posts up about:

  • Union – This was a biggy. Moock’s Union platform was a key part of getting this concept off the ground. It handled all the multi-user aspects.
  • Red5 streaming – Liam put in some sterling work building our own streaming-video server to handle the video load and synchronising streams between multiple users. We encountered some not-inconsiderable gotchas and issues with dealing with rtmp streams and Red5′s quirks too.
  • PureMVC – not our first go round with PureMVC but my first real experience with what’s becoming our framework of choice.
  • AfterEffects/Video work – not sure there’s a post in this but it was fun!

That’s mostly what comes to mind now but we’ll be back with more details once the dust has settled.

For now though, have a great Christmas and enjoy the races!


10
Dec 09

Do believe the Hype

Wow. Just stumbled across this http://hype.joshuadavis.com/

Screenshot of objectPool class in action

Joshua Davis (one of my highlights from FOTB this year) and Branden Hall have released the HYPE framework. Lots of cool little classes to make beautiful things quickly.

Extremely cool of them to share their genius with us all so just spreadin’ the love…


Blog WebMastered by All in One Webmaster.