The Adobe AIR 2.0 Beta and Flash Player 10.1 Beta releases are out and filled with some really cool, fun and powerful features. These are big releases as far as increasing developer productivity and in my opinion will further convince people to choose the Flash Platform as their technology direction.
I’ve been working with these two prereleases on top of Flash Builder (Flex 4) to build samples for Tour de Flex and made some notes on them as I’ve been trying the different APIs. I will summarize what I have learned so far and add to this post as I continue through them. Some of these may be totally obvious, but I will list them here anyway. The current Tour de Flex samples were built using the AIR 2.0 SDK build 121509. You can download AIR 2.0 Beta here. Some things to note:
1. Microphone Sample – this sample can be used with the internal microphone but you do need to make sure it is enabled and the volume is up. I also had to increase the volume on the Flash Player settings on my Macbook for the microphone to pick up the sound. To check your settings, go here and right click on the settings manager image, then choose ‘Settings’, and Microphone.
2. Gestures Sample – this sample requires multi-touch enabled hardware. I am using a Macbook which does have multi-touch support in the trackpad, but unless you have this or a multi-touch enabled device, the sample may not work for you. This article lists some devices that contain the support, as well as some other very useful info. Also, many samples out there are straight ActionScript classes that extend Sprite (for instance the one in the article referenced above). If you copy these into an AIR project and set the ActionScript class as the default application, you may find that you still see nothing when you run it. That is because you still need to go into the application descriptor file (yourappname-app.xml) and set the visible flag in the initial content to true. For instance:
... <initialWindow> <!-- The main SWF or HTML file of the application. Required. --> <!-- Note: In Flash Builder, the SWF reference is set automatically. --> <content>[This value will be overwritten by Flash Builder in the output app.xml]</content> <!-- The title of the main window. Optional. --> <!-- <title></title> --> <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. --> <!-- <systemChrome></systemChrome> --> <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. --> <!-- <transparent></transparent> --> <!-- Whether the window is initially visible. Optional. Default false. --> <visible>true</visible> ...
3. Global Error Handler Sample – this will only work right if you are running in ‘Run’ mode, debug mode will stop on the error itself and thus not be ‘handled’.
4. Native Process Sample – this sample assumes some default paths on the different OS’s, so if you have something custom then the ping may not work unless you change the path to the correct executable for your particular installation.
5. Socket Server Sample – this sample has two apps within it, a client app and a server app. The ServerSocket class is the new AIR 2 class allowing your app to be a socket server, and should first be started with the SocketServerSample.mxml file. Simply hit the ‘Listen’ button to start the server then run the SocketClientSample.mxml file to open the socket to the server and send data to it.
6. Mass Storage Device Detection – this sample will allow you to access an external storage device such as a USB drive. Plug in an external device while running the sample and you will see the information about the device displayed as well as have the ability to browse the contents.
7. NetworkInfo – this sample will show your currently available network interfaces and some corresponding information about them.
8. Globalization – there are a few samples here that show how you can now do formatting of dates, numbers and currency based on a selected locale.
9. OS File Security Download – this sample shows how you can use the new File.downloaded property to check if a file has been downloaded or not. Run the sample and double click on a file, and a message will be displayed to indicate its download status.
10. DNS Lookup – this sample allows you to retrieve information about a specified Domain Name Server address. Simply run the sample and enter the domain name to perform a lookup. It also gives you the ability to specify an IP address and do a reverse lookup. This sample was based on a sample found here: http://www.insideria.com/2009/10/air-2-enhancements-complete-ov.html
Lastly, here are some good links with more information and samples for these two prereleases:
- Christian Cantrell’s list of new features
- AIR 2 Demo Apps
- Flash Player 10.1 Demos and Info
- Christian Cantrell’s AIR 2 Resource Links
- Christian Cantrell – Gesture API Demo
- Christian Cantrell – Creating a Socket Server
- Christophe Coenraets – Open in Excel
- Christophe Coenraets – AIR 2 Web Server using SocketServer API
- Christophe Coenraets – Embedding Tomcat using NativeProcess APIs
- Christophe Coenraets – Voice Notes (using the AIR 2.0 Microphone APIs)
- Lee Brimelow – Flash Player 10.1 multi-touch FAQ
About the Author (Author Profile)
Sites That Link to this Post
- Have you looked at Tour de Flex lately? « Greg Wilson's Ramblings | January 25, 2010