This blog has moved to a new location! http://iqandreas.github.com/

Sunday, April 25, 2010

Getting started with Flash Player 10.1

Flash Player 10.1 added several neat multi-touch, gesture, and accelerometer input features. There are several more neat features of the new Flash Player, but the new input controls are what I find the most captivating (that, and global error handling, FINALLY!). The rest can be found on Adobe's website:
AdobeLabs - Flash Player 10.1 Features and Enhancements

Adobe really put a lot of effort into getting the newest version of Flash Player to work on numerous devices, naming this project the "OpenScreen Project". Quoting Adobe - "With support for a broad range of mobile devices, including smartphones, netbooks, smartbooks and other Internet-connected devices, Flash Player 10.1 allows your content to reach your customers wherever they are." [side note - sadly, iPhone support was shot down]


Flash Player 10.1 is still in the "prerelease stage", meaning it is not released as an "official" or currently updated version just yet. I'm not sure if bugs are being ironed out, or if Adobe mainly wants to wait until Flash CS5 is out. However, the new player is still available for developers who want to test out the new features.

So far, FP 10.1 seems to be working just fine for my every day uses, and haven't run into any major bugs yet. In fact, (since I'm in Linux still) the old Linux Flash Player (version 10.0.45.2) had several bugs which were never ironed out, and according to several Google results were quite common. However, with the new version, those bugs seem to be gone (at least so far):
[Solution] Flash sound stops working in FireFox on Linux Ubuntu 9.10
[Solution] Adobe TV crashes FireFox on Linux Ubuntu 9.10


Since 99.8% of your site/application/game users won't have version 10.1 installed, I really don't recommend using it for your sites just yet. However, if you have a phone or computer with multi-touch capabilities it might be fun messing around with the new features. In addition, if you read up on the classes and functions enough now, by the time it is fully released, you can be first in line when clients are looking for the newest features for their product.


So, where do I get started?

FIRST, you need to download the actual Flash Player 10.1. As with Flash 10, the browser and standalone versions are two different things, so if you update the browser player to 10.1, the standalone player will still be the old version and vice versa, so unless you plan on keeping the old player for any specific reasons, remember to update them both.

There is also a difference between the debug version and the regular version. Basically, the debug version is good if you do a lot of testing, since the error messages show up as dialogs, along with several other features not available in the "regular" release of the Flash Player. Otherwise, errors are silently ignored, which is good for regular users, but really annoying if you can't get your code working right, and you are having a hard time figuring out what's going wrong and where.

All versions of the player can be downloaded here:
http://labs.adobe.com/downloads/flashplayer10.html


THEN, all you need to do is download the new SWC library with all the new classes. I'm pretty sure they are just the "shells" for the classes which expose all functions and properties rather than contain actual code, just as the ActionScript files for MovieClips don't contain the actual code for them, but just expose functions to allow code hinting etc for developers. [a VERY good read on the matter]

I was worried I would need an updated compiler, but to my joyous surprise, you can still keep using Flash Professional, Flex Builder, the Flex SDK, or whatever compiler you use without any modifications. There should be dozens of tutorials on importing SWC libraries into your current editor, but if you can't find anything relevant, ask in the comments section, and I will lead you in the right direction. Don't forget to post what type of IDE you are using (Such as Flash Professional CS4 or FlashDevelop etc).

The SWC can be downloaded on the same page as the Flash Player (how convenient)
http://labs.adobe.com/downloads/flashplayer10.html#pgswc


Downloaded and ready! Teach me how to use it!

Sadly, I don't have any tutorials for it (I don't have a touchscreen or even a mobile device newer than 10 years old) but several others out there have already put up tutorials for FP 10.1 development.

gotoAndLearn - Multi Touch Gesture Applications
Multi Touch in AS3 / Flash Player 10.1 - Part 1. Setting Up
Multi Touch in AS3 / Flash Player 10.1 - Part 2. TouchEvent & MouseEvent Sequences


I'm in need of a lot more tutorials and examples, so if you know of any other good sources, or have written any good tutorials yourself, just leave a link in the comments section! :)


Some further reading

As always, I am never the first to write about things, so here are some helpful links which hopefully helps someone out there.

Adobe Labs - Adobe Flash Player 10.1
Introducing Adobe Flash Player 10.1 public prerelease
Flash Player 10.1 prerelease software demos and interviews
Adobe TV - Multi-touch capabilities of Flash Player 10.1
Kirupa Forums - Disappointing FP 10.1 First Impressions
TourDeFlex - according to Adobe, some examples should include some FP 10.1 features as well. Still very neat if you haven't used it before!


Good resources for FP 10.1 development

Keep these links in your toolbox. They usually come to use quite a bit:
ActionScript 3.0 Language Reference (with updates for Flash Player 10.1)
ActionScript 3.0 Developer's Guide (also with FP 10.1 updates)
Adobe Forums - Flash Player 10.1
Adobe Bug tracking and management - On case you do find anything wrong with the new version. When submitting, remember to check for existing bugs, as chances are you aren't the first person ever in the world to run across that bug. ;)



If anyone has any demos of what they have accomplished with the new features in FP 10.1, leave a comment and share your work with others (source code is appreciated, but not required). I will provide the SWF hosting if you require it.

No comments:

Post a Comment