Daniel Dura

All About the Adobe Flash Platform

Archive for the ‘Platforms’ Category

Update: WordPress Comment Moderator

with 4 comments

This is just a quick post to update you on the progress of the WordPress comment moderation application that I am building. It is coming along very nicely, and I should have a beta early next week. Unfortunately I spent a full day trying to get my WordPress installation back up and running after a botched upgrade to 2.6. Just two notes about that, make sure and disable plugins and clear your cookies!

Back to the application, the first version is going to be pretty simple and will only moderate comments for a single blog. I have heard many requests for multiple blog support, that looks like it will be the first feature added after an initial release. The first release will only support WordPress 2.6+, as that is the only version I am testing it against. Last but not least, I have received a few questions about this being open sourced. I am sure I will open source it eventually, but it isn’t the highest priority right now. Once I get an initial stable version out, I should be able to get the code to a place where that is possible.

Anyways, keep an eye out on this blog early next week for the beta. (As for this weekend, I am going to be gutting out a rental house after some of my tenants trashed it, oh joy!)

Written by Daniel Dura

September 12th, 2008 at 11:06 am

WordPress Comment Moderator AIR Application

with 29 comments

UPDATE: This application is now available. Please see the following page: http://www.danieldura.com/moderator/

I wanted to give everyone a quick sneak peak of something I am working, that I should be releasing next week. As you can tell by the footer on this page, this blog is powered by WordPress. I have found WordPress to be one the best, most feature rich, well coded, and well designed publishing platforms. It is easy to update, is customizable, and most importantly (for me atleast) is very extensible.

One problem I have though is that the dashboard is a web based application in my browser and one of the functions I use the most is, comment moderation, only sends notifications via email. What I really wanted was a desktop solution to alert me when new comments are awaiting moderation.

I did find one solution, but it is only on Windows. Man, I really wish there was a way to have a cross platform application that even allowed me to approve and deny comments from my desktop. Hmm… what could I use…

As you probably figured, AIR is a PERFECT candidate for this use case, and so I just went ahead and built an app myself. This screenshot is the application actually working. I have it running against a local version of a WordPress installation. It gives alerts when new comments are awaiting moderation, tells you how many comments are awaiting moderation in the dock menu, and allows you to approve comments, mark them as spam, or delete them.

If you want to try out the application, you will have to wait a week or two. I still have a few bugs to fix, and I want to test it out against a real installation first, probably mine (or maybe my brother’s since he doesn’t seem to be posting much lately.) If you have any feature requests or if you think this is interesting, please feel free to leave a comment, it will give me a chance to test out the app as well!

Written by Daniel Dura

August 29th, 2008 at 9:52 am

Posted in Adobe,AIR,Showcase

AOL Embraces Flash with AIM Express

without comments

This morning the folks over at AOL, and more specifically the AIM team, launched version 7 of AIM Express. And guess what, it is built using Flash! It really is a great experience and a quality example of the power of ActionScript 3.

What is most interesting to me though is not the client, but the API that they have made available to ActionScript developers. You can go to Google Code and actually use the same base AIM AS3 library to build your own client or integrate AIM functionality into your application! If you know anything about my history with the AIM client and Central, you will know how excited I am about this.

When it comes to building applications that have chat, presence, or some type of collaborative functionality, you have to consider the infrastructure it might take to get up and running. With this library, all you have to do is build your client, and let the user utilize their existing AIM/ICQ account! And guess what, I am sure most of them already have one of those…

Written by Daniel Dura

August 20th, 2008 at 7:09 am

Video: Creating a Local Database in AIR

with 4 comments

Recently I filmed a video for the Adobe Developer Connection on how to create a local database in AIR. You can see this video below. I have already filmed two more videos, one on creating custom window chrome in AIR using Flex, and a second on how to encrypt data. I will post them on this blog once they are uploaded.

Written by Daniel Dura

August 6th, 2008 at 9:35 am

Saving Encrypted Data in AIR

with 6 comments

Have you ever wanted to store a users password, you know, that little checkbox that says ‘Save Password’ on any login form. Or maybe you just want to persist a session token or other information. You could use the Local Shared Objects or even the File API, but that isn’t very secure. How do you store sensitive information that your AIR application needs to persist?

Luckily, there is an often overlooked API for just this use case. It is called the EncryptedLocalStore and is actually quite simple to use. The EncryptedLocalStore API persists data to the local system using a name-value pair scheme that is specific to each application. The name is a simple string, and the data is a ByteArray. The data is stored using both the application ID and the user information from the local system, so other AIR applications and other users cannot access the data. This API is actually hooking into the Keychain functionality on Mac and DPAPI on Windows. The data is encrypted using AES-CBC 128-bit encryption. So the main point to take away is that the data is very secure and other AIR apps or users will not be able to easily access it.

So, how do you actually use the API? Well, lets assume that we have a session ID that is a string and we want to persist in the EncryptedLocalStore. Lets also assume that the session ID is stored in a variable called ‘sessionId’. One thing to keep note of is that the data must be stored as a ByteArray, so we first need to create a ByteArray instance and add the string value to it. The code might look something like this:

[as]
var bytes:ByteArray = new ByteArray();
bytes.writeUTFBytes( sessionId );
EncryptedLocalStore.setItem( “sessionId”, bytes );
[/as]

To retrieve the data, you simple retrieve the ByteArray using the getItem API, and then read your UTF string value out of that ByteArray:

[as]
var sessionIdBytes:ByteArray = EncryptedLocalStore.getItem(“sessionId”);
var sessionId:String = sessionIdBytes.readUTFBytes( sessionIdBytes.length);
[/as]

To remove an item from the store, you simply call the removeItem API:

[as]
EncryptedLocalStore.removeItem(“firstName”);
[/as]

There are a few things to note when using the EncryptedLocalStore API. First, the API is syncronous and is geared towards small amounts of data. While there is no practical limit, any ByteArrays larger than 10MB might cause performance issues. Second, when debugging your application using ADL, we are actually using a different store than what is being used for installed applications. And last, when uninstalling an AIR application, the data in the EncryptedLocalStore is NOT deleted.

One last note as well, this API is available to both Ajax and Flash based AIR applications, like all ActionScript APIs.

Written by Daniel Dura

June 27th, 2008 at 9:56 am

AIR Tips and Tricks – Video, Slides, and Code

without comments

For the past few months the crew here at Adobe, along with a few other brave adventurers, spent a total of more than four weeks traveling throughout Europe educating developers in many countries on AIR. My presentation for that trip was called ‘AIR Tips and Tricks’. Below I have included a ZIP file of all the source code for those presentations along with a PDF of the slides. Mike Chambers has also posted a video of the presentation as well, which was recorded in Munich.

Written by Daniel Dura

June 25th, 2008 at 9:42 am

How to Push AIR Application Updates

without comments

One of the benefits of web applications is the ability to quickly publish updates to the application to your end users. As soon as you upload the changes to your web server, your users and enjoying the latest version! With AIR, this becomes a little more difficult. What if your user is offline? Should they be able to use the application if a new version is available? AIR provides an updater API (Updater.update), which will install a new AIR file over an existing application, but doesn’t solve any of the problems mentioned above.

Enter the new Adobe AIR Update Framework. This framework was developed internally and allows you to focus on building your application, not the logic for handing updates. Using a simple API and schema for storing version information, the updater API will allow both Ajax and Flash/Flex developers to push updates with a minimal amount of work. On top of the logic for handling updates, they even provide some default UI for you to use. So, if you are trying to figure out how to handle updates in your AIR application (which you should definitely be doing starting in the first version of your app) you now have no excuse to put off that work.

Written by Daniel Dura

June 24th, 2008 at 7:41 am

Posted in AIR,Ajax

Free Flex, Flash and AIR Books

with one comment

Recently I was lucky enough to participate in the authoring of a book on JavaScript development in AIR with Mike Chambers, Kevin Hoyt, and Dragos Georgita. What has been great about this book is how well it has been received by the community and the fact that you could download a PDF copy of it for free (you can still purchase a hard copy as well at Amazon). What wasn’t great, was that it was only in English.

Over the past few months, Mike Chambers has been working on a solution to this problem, and what he has come up with is going to be an amazing resource. The site is called toString.org and encourages developers to submit translations to the site for publishing. Mike describes the site as:

…a site that hosts books about Rich Internet Applications, with a focus on book that leverage the Adobe RIA Technology Platform (Adobe Flash Player, Adobe AIR, Adobe Flex).

Currently there are two books on the site, both the Flex and the JavaScript pocketguides for AIR development. There are already a few translations as well. Mike is not done with the site yet as well and says that many new features are coming soon, including offline support through an AIR application, REST APIs, and diffing capability for reviewing changes between updates.

Written by Daniel Dura

June 23rd, 2008 at 6:11 pm

AIR 1.1 Released

with 2 comments

Yesterday we released a ‘small’ update to the AIR runtime. In reality, this release has a few new features and many bug fixes that should relieve a few of the pain points you may have encountered in AIR 1.0. The major announcement is that we now support full localization, which includes not only the localized installers, but also the ability to develop localized applications.

AIR Installer Localized to French

Some of the highlights of this release include:

  • Fully localized runtime and installers, as well as numerous API additions to support building localized applications.
  • Support for certificate migration. If you have released a self-signed application, you can now use the update API to initiate the installation of an AIR application that chains to a certificate authority.
  • Windows XP Tablet PC Edition support. This includes a fix that will pop up the visible keyboard when a user selects a text field in the application.
  • Addition of the File.spaceAvailable API. This will allow you to determine the amount of space that is available on a volume.
  • Numerous garbage collection improvements. One of the issues that was solved on Mac OS is a bug that was not deallocating memory which was assigned to the AIR application. This wasn’t a major issue; the memory could still be reallocated to other applications if needed. But now when a user goes to Activity Monitor on mac they should see the actual memory that is being used by the AIR application. There were also numerous other fixes that were made which should fix a few leaks you may be seeing.

If you are currently developing Flex applications and would like to update Flex Builder to use AIR 1.1, check out this tech note describing how you can update the AIR framework. The Flash team has also released a similar tech note describing how to update Flash CS3 Professional. And last but not least, the Dreamweaver team has released an updated version of the AIR extension.

Along with this launch, Aptana has announced updated support for 1.1. So if you are currently using Aptana to develop Ajax based AIR applications, go to http://www.aptana.com/air to get the updated plugin.

The AIR team definitely deserves a round of thanks for the hard work they put in to getting this release out the door. They barely even caught their breath after the 1.0 launch before they started working on this release. Now onto the next one!

Written by Daniel Dura

June 18th, 2008 at 8:07 am

Posted in AIR

Want to Hack on the Flex Compiler?

with one comment

One of the great things about the new Flex open source project, is that it isn’t just the framework that has been opened up. We have even pulled back the covers on the compiler. Today, Matt Chotin posted on the open source wiki what used to be an internal document that describes how the Flex compiler, usually known as mxmlc, is architected. So if you are looking to hack around on the compiler, fix bugs, or even add functionality, check out that link.

You may be wondering to yourself though, what can I actually do with this information? One great example is the new Flex code coverage tool called Flex Cover written by Joe Berkovitz. The tool basically adds functionality to the Flex compiler so that the bytecode it outputs contains information about what code has been executed. You can then take this information to generate a report which allows you to see which lines of your ActionScript code actually executed during that session.

So what are you thinking of using this information for? How about instrumenting the compiler to do some code optimization? Or maybe just fix that compiler bug that keeps annoying you? How about adding an entirely new feature to Flex? Now that it is all open source, go ahead and try it out!

Written by Daniel Dura

June 17th, 2008 at 6:25 am

Posted in Flex