All About AIR, Flex, and Flash

Archive for the 'Actionscript' Category

The Official Google Maps Flash API

For a few years now, I have been waiting for this: an official Google Maps Flash API (based on ActionScript 3). You heard it right, instead of using one of the many other solutions which tapped into the tiling servers of the various mapping providers, this is the real deal. And on the surface it looks great.

Google Maps Demo

It is also interesting to hear the Google Maps team talk about Flash on their blog, and discuss why they chose to do this project. In the post they maintain that performance is a big part of it, and that with Flash, the smoothness and speed of the mapping component are much better. From just playing with the demo they put together on their blog, I agree. The tiles load very quickly and the transitions are very smooth. It also integrates video very nicely. Obviously this isn’t to say that the current Ajax implementation is bad, but the Flash version definitely gives the map that little extra polish.

It is great to see Google realizing the benefits of the Flash platform. (I think they got bitten by the bug when they started Street View.) If you are hoping to see more from them, please show your support for this project and download the SDK and start playing with maps in Flash today.

No comments

Google OpenSocial ActionScript Library

There definitely has been a bunch of buzz about Google’s OpenSocial initiative in the past few days. I have always been intrigued by social networking and was hoping that one day somebody would create a central repository for this kind of information. I get tired of adding all my friends to different social apps every time I sign up for one. It appears from the outset that Google is trying to fix that, and I believe nobody is in a better position to do just that than they are.

Today they released the documentation on their API. It looks like right now they do not have an ActionScript version of it available on the site. I intend to fix that. I have created a Google Code project at http://code.google.com/p/as3opensociallib/. I have not committed any files just yet but intend to start on this project right away so I can play with the API a bit and get to know it. If you would like to contribute to this project or just keep an eye on it to see when it is available, keep checking the Google Code project or this weblog.

6 comments

Apollo Native File Dialogs

Currently the Apollo Alpha doesn’t support native file dialog boxes (it will before the final official release.) Despite that, there is a way to get this functionality now by using existing Flash Player APIs.

I will first show how to display a file ‘Save’ dialog box which allows the user to specify the name of the file they would like to write to the disk. This will allow them to type in the name of a file that may not exist. The user can also select a file that already exists and the dialog will prompt the user that they are about to replace that file on the system.

To accomplish this in Apollo, you use the ‘download’ method on the flash.net.FileReference class. Because the flash.filesystem.File class extends FileReference, you can employ this technique by using that class as well. The trick to getting the File reference without actually downloading the file is to cancel the URLRequest before it executes. See the code below for an example:
Read more

6 comments

New AS3 XMPP Library on Adobe Labs

Almost a year ago I began working on an XMPP library using ActionScript 3. XMPP is a protocol which enables real-time collaboration and presence information to be communicated between clients. (For more information about XMPP see http://www.xmpp.org.) With the new Socket API in Flash Player 9, writing a formal XMPP protocol library in ActionScript was much easier than it was in previous versions of the player and showcased some of the new features of the ActionScript 3 language. I decided to start to write one from scratch.

I have submitted this library to the Adobe Labs repository. You can browse the repository using the link below. The path to the source is ‘projects/xmpp’ in the ‘flashplatform’ repository. Christian Cantrell has also made a great post on his blog that describes how to checkout the latest code here.

Over the past year I have made many optimizations and feature additions to the code base and I am still actively developing the library. If you have any suggestions, questions, or patches related to this library, please feel free to email me directly (ddura@adobe.com).

  • Browse the source here.
  • Download the latest nightly drop of source from the Adobe Labs repository here. (This contains the entire labs source tree.)

Update: The code for this library has been moved to Google Code, where some bug fixes and changes have occured. Be sure to update to that version. Link

6 comments

ASDoc Now on Labs

A version of ASDoc that we use internally for generating our documentation is now available on Adobe Labs.

3 comments