Age of Defenders

Here’s a really nice browser-based Flash game that has just been ported to iOS and Android. Age of Defenders is a real-time multi-player tower defence game built with Flash and Adobe AIR. One of the really nice features of its online play mode is that you can do battle with other players across multiple platforms. I think you’ll agree that Age of Defenders looks gorgeous and it will also be available soon for Blackberry Playbook, which demonstrates the cross-platform strengths of AIR.

One thing that does concern me slightly, and it’s also the case with the excellent Machinarium, is that lower-end devices such as iPad 1 seem to be excluded from the party. This is a real shame as the iPad 1 is certainly no slouch and it does show that perhaps AIR isn’t quite there performance-wise yet. I’m personally hoping that Stage3D and the Starling framework will help in this regard when they eventually make it to AIR for mobile. However, for those with the right hardware, it’s a really nice gaming experience.

For an interview with the Age of Defenders lead developer, head over to Adobe Gaming Evangelist, Tom Krcha’s blog.

Life after Flash Mobile Player

I can’t say I was surprised by Adobe’s decision to kill the Flash Player for mobile, and I’m not entirely sure what all the fuss is about from the Flash community. After all, how many Flash developers out there were actively developing Flash content for mobile delivery? I bet it was a tiny percentage.

So why did Adobe’s mobile strategy for Flash Player fail so badly? Well to be honest. Apple’s decision not to support Flash on iOS pretty much killed Adobe’s plans from the outset. But it’s also clear that there wasn’t much enthusiasm for Flash on Android either. Performance across devices was variable and even Flash on high-end tablets seemed to struggle. So why was this the case?

Well, I think Flash was pretty much a victim of its own success in this regard. It’s clear Adobe spent considerable time and energy optimizing the Flash runtime for mobile but unfortunately that was just half the battle. There really isn’t much that can be done if the content being run by the player is bloated and not optimized for mobile, which unfortunately is the case for almost all SWFs out there.

Developers had simply become accustomed to creating content for desktop with almost no consideration for memory and CPU usage. What we ended up with was a web chock-full of SWFs that strangled the life out of every mobile device they ran on. A decade, or so, of not having to care about optimization had essentially set Flash up for a very bad fall.

But ultimately it wasn’t the performance that was the real killer. It was a simple issue of usability. Even content that ran well was almost impossible to use. With the tightly packed pixel density of mobile screens it was difficult to interact with buttons and links that were designed for pixel-perfect mouse clicks rather than fairly inaccurate finger taps. Of course, this isn’t a technology issue and certainly isn’t exclusive to Flash, however with so many Flash sites out there the problem was quickly associated with the platform.

By excluding Flash from iOS, Apple has effectively cleaned-up the web. Companies who wanted a mobile web presence were forced to ditch Flash and redesign their site. In the process this allowed them to create simpler, cleaner and ultimately more usable experiences. The success of the App Store did the rest. Games and applications that were once delivered via the browser had found a new home and another reason for having the Flash plugin had eroded away.

So while many will feel aggrieved, disappointed, and angry at Adobe’s decision to stop developing Flash Player for mobile, I think it’s hard to argue against it.

You’ll still be able to develop for mobile using Flash, but it won’t be for the browser – you’ll be targeting the Android Marketplace and Apple’s App Store instead. This makes perfect sense as this is the expected location for the sort of rich content that can be created using Flash. And let’s not forget that the Flash Player will continue on desktop where it has had so much success over the years. Many of the recent announcements, such as Stage3D, create exciting new possibilities and will hopefully be making their way to mobile soon too.

But for rich, interactive web-sites, it’s HTML 5 all the way! Right now, we have a clean slate. It would be easy to let the new JavaScript APIs provided by HTML 5 and the many great JavaScript libraries out there go to our heads. However, the last thing we need is all the same mistakes that were made with Flash being made with HTML 5. Experiment by all means, but when it comes to sites for customers and clients, let’s keep the web usable folks. Happy coding!

Review: Flash Development for Android Cookbook

With Android’s growing momentum, the Flash platform is perfectly positioned to allow developers to take advantage of its runtime to distribute content across mobile. Part of Packt Publishing’s popular Cookbook series: Flash Development for Android Cookbook by Joseph Labrecque offers over 90 carefully selected recipes for demonstrating mobile concepts related to Android and providing step-by-step practical examples.

While knowledge of ActionScript 3 is a requirement, even beginners should be able to grasp most of the concepts covered and easily lift the code examples straight from the book into their own projects. Impressively, the reader isn’t restricted to a single IDE. Instead many popular options are covered, with time spent in the opening chapter detailing how to configure Flash Professional, Flash Builder and the popular Powerflasher FDT. And while its focus is predominantly on pure ActionScript, the author also finds time to cover the Flex framework where appropriate.

With your development environment set-up, attention turns to your Android handset and the basics of device interaction. A series of concise and straightforward recipes highlight how to take advantage of multi-touch, gesture support, the virtual keyboard, and any physical keys found on the device. For anyone used to development for desktop, the content covered here will help get you in the correct mindset for targeting mobile.

Android devices also feature a wide range of sensors, and the book spends many chapters exploring those that are accessible from Flash. The geolocation sensor is covered and examples of it being used in conjunction with with a third-party API are given. Unfortunately the API chosen was Google Maps, which has now been deprecated. Nevertheless, it does illustrate the point and the techniques can easily be transferred to alternative services.

Valuable time is also spent covering the accelerometer, including how to detect changes in the device’s orientation. The difficult subject of screen layout is also addressed, with examples highlighting how to adapt your application’s layout in response to orientation changes. Some recipe’s demonstrating the strength of Flex for such tasks are also given, which is a useful insight for those who aren’t familiar with the framework.

Probably the most popular sensors on any mobile device is the camera, and the cookbook shows how to capture both still images and shoot video. As well as Flash’s traditional camera support where video is rendered directly within your application, the reader is also shown how to launch the device’s native camera app to perform these duties. When targeting Android, it’s important to deliver a consistent experience to the user by presenting them with familiar native apps for such tasks, and this is successfully highlighting. Loading images from Android’s Camera Roll app is another example of this.

Both video and audio, in general, are well catered for. In addition to capturing video, there are plenty of examples showing how to playback both local and remote video. Streaming video from a Flash Media Server is also included. There’s even room to explore microphone audio capture and the generation of sound at runtime. Unfortunately hardware accelerated H.264 video playback, which is new to Flash, arrived just a little too late to appear in the book, which is shame as it’s a great feature.

The format, allows you to dive right into any subject you like, with the majority of recipes being independent from one another. This makes Flash Development for Android Cookbook a resource worth keeping close at hand during development. You’ll find yourself frequently turning to it, either to serve as a reminder or to learn something new. While it might not always go into the greatest detail, what we have is a wide coverage of what Flash has to offer on Android. You’ll find that after each recipe you’ll be in a good position to go on and seek any further knowledge you require.

A very easy and concise read. I highly recommend this book to any Flash developers wishing to explore Android development.

You can purchase Flash Development for Android Cookbook from amazon and the Packt Publishing website.

Concurrency in Flash

One of the most frequent requests for the Flash runtime has to be the ability to leverage multi-core architecture using ActionScript. Well as you can see from the video below, concurrency is coming to ActionScript.

The hour long session covers quite a lot of ground and shows code examples of the new ActionScript worker API in action. Of course, multi-threading already exists in the runtime via the many asynchronous ActionScript APIs; plus Flash’s rendering pipeline is also multi-threaded. However, this will be the first time that developers will actually be able to execute their own code on background threads. It will also be possible to render to the display list from your threads, which is quite an exciting new feature.

Happy Halloween

Get Adobe Flash player

I thought I’d create some spooky ghosts using Starling to scare my WeeMee with. Enjoy Halloween everyone!

Starling Experiment

I’ve been playing with the Starling framework and so far the performance on desktop has been pretty good. Here’s a little experiment I bashed together.

Get Adobe Flash player

Just click on the little rotating sprite then watch all hell break loose. Oh and once things get a bit hectic, run your mouse over them to create some nice effects.

Vlad’s Vampire Bats

The Flash platform has had some success with children’s interactive books and here’s another one that’s arrived just in time for Halloween. Vlad’s Vampire Bats tells the story of Vlad; a lonely vampire with a problem: everything he touches turns into a bat. You’ll be taken through 17 screens of animated fun, lighting candles with your finger, exploring Vlad’s castle, and of course, turning things into bats!

Interestingly Vlad’s Vampire Bats was created by a design team who had no prior programming experience. The guys at Frosby Designs learned ActionScript 3 from scratch in order to put the app together, which is a great testament to the strengths of the Flash platform.

Sounds like fun but I’m obviously a little too old for this app so I decided to see how wee Freddy, my one year-old nephew, would respond to it. Well you’ll be pleased to know he laughed his little head off and constantly slapped my iPad’s screen with delight so I’m guessing Frosby got this one just about spot on. Great stuff!

Vlad’s Vampire Bats is available for iPad, iPhone and Android.

It’s Not All About 3D You Know

Yup, that’s right. With all this talk of Stage 3D lately you could be forgiven for thinking that Adobe has given up on simple 2D games. However that couldn’t be further from the truth. It may not be obvious from its name, but the Stage 3D APIs are also perfect for rendering high-performance 2D graphics.

What? You don’t believe me? We’ll why not take a look at the Starling framework. It’s an ActionScript 3 API that harnesses the power of the GPU to produce 2D rendering performance never before seen in the Flash Player. I know what you’re thinking; it all sounds pretty complicated and scary but it really isn’t. Starling’s API closely follows Flash’s native display list classes, allowing you to quickly get to grips with it. You’ll be moving thousands of sprites around the screen and dazzling friends with impressive particle effects in no time all all.

What’s more, Starling is a direct port of the Sparrow Framework, which is a native iOS library. This is great news as it means you’ll have the potential to write blazing fast mobile games too! After all, Sparrow has proven itself in the field and there’s no real reason why Starling won’t perform similarly once ready for iOS. And while many of you will probably be eager to get your teeth into 3D, don’t forget that simple 2D games are not only cost effective but are typically more accessible. Just take a look at Angry Birds or Tiny Wings.

It’s still early days for GPU acceleration in Flash but I’d encourage you to start experimenting. And Starling isn’t the only 2D framework; there’s also ND2D, which is looking similarly impressive.

Unreal Engine 3 and Alchemy

The announcement of Unreal Engine 3 for Flash Player 11 was huge and goes to show just how powerful Stage 3D is. If you’re in any doubt about the potential of Flash Player 11 then just take a look at the video below, showing a technical demonstration of Unreal Tournament 3 running in the browser.

But the hardware acceleration of Stage 3D isn’t the only thing worth getting excited about. You ever thought about how they actually ported Unreal Engine’s source code to Flash? After all, re-writing just over a million lines of code in ActionScript 3 just isn’t practical. Well the conversion was achieved using Adobe Alchemy, which enables the conversion of C and C++ code into high-performance ActionScript bytecode. If you want to know more then take a look at this great insight into Alchemy presented at Adobe MAX.

So there you have it. Flash is now capable of delivering a high-quality console gaming experience directly within the browser. And if you’re considering writing 3D games content for the platform then you really can’t get any better than the Unreal Engine.

I’ll leave you with a quote from Epic Games’ press release:

UE3 is constantly evolving, with new breakthroughs, technologies and optimizations for multiple platforms. Flash Player 11, with its hardware accelerated, programmable graphics pipeline, is now capable of running triple-A gaming content authored for high-end platforms using the industry’s latest tools and technologies.

Learn AS3 for Free

So I think you’ll agree that ActionScript has come a long way since its humble beginnings as a simple scripting language for controlling timeline animations. However, while each new version of the language has been accepted with open arms by developers, creatives have been less willing to embrace it. This is a terrible shame, because it’s the incredible work by all you animators and illustrators out there that put Flash on the map in the first place.

So if you’re still tinkering with ActionScript 2, or even 1 then you might be interested in Hoss Gifford’s free ActionScript 3 training course. It’s taking place in Glasgow on the 24th and 25th of November and is aimed squarely at people who currently throw smatterings of ActionScript onto the timeline.

I had the pleasure of working with Hoss a few years back and he’s one of those rare breed of people who has mastered Flash from both a programming and creative perspective. He’s also an exceptional communicator who’s spoken at various conferences all over the world. What I’m trying to say is this. If anyone can teach ActionScript 3 to non-programmers, it’s Hoss. Do yourself a favour and sign-up for it. And hurry, there’s limited space.

Oh and did I mention that he’ll have you write a game and stick it on iPad, iPhone and Android by the end of the second day? Exciting eh!

And yes, I did say it was free.