September 22, 2009

New ActionScript and Flex Spell Checking Engine on Adobe Labs

Adobe's Linguistic Services team recently launched a project code named Squiggly on Adobe Labs. From the project homepage:

Squiggly is a spell checking engine for Adobe® Flash® Player and Adobe AIR®. The Squiggly library allows you to easily add spell checking functionality in any Flex 3 based text control. The distribution package consists of a utility for building your own spelling dictionaries, a sample English dictionary, an ActionScript package that checks individual words for spelling accuracy, and sample code that demonstrates "check as you type" functionality.

The rest of the details can be found on Labs along with a simple demo.

Posted by cantrell at 9:56 AM. Link | Comments (0) | References

December 5, 2007

Encrypting Data in AIR

AIR applications often need to store credentials. Many web services out there require authentication, which means that AIR applications need a secure way to store sensitive data. I first ran into this issue when I wrote Salsa, an Amazon S3 client. Salsa needs the end user's public and private access keys for signing requests, but since both keys are long arbitrary strings that are almost impossible to memorize, I couldn't ask the user to enter them each time they wanted to use the application. And for obvious reasons, I couldn't store them in plain text. I needed a way to persist the user's credentials in way that would not allow other users or processes to access them.

This was back in days of AIR beta 1. The only option I had at the time was to encrypt the credentials myself using a pass phrase provided by the end user. Each time the user started the application, therefore, I had to prompt them for their pass phrase which I'd use to decrypt the public and private keys. If they lost their pass phrase, they had to reenter their public and private keys, as well as enter a new pass phrase. From a usability perspective, this was not the experience I was after.

But then along with AIR beta 2 came the flash.data.EncryptedLocalStore API. There have been some small changes in M6 (the upcoming beta 3), but it's essentially the same. The EncryptedLocalStore APIs use DPAPI on Windows and the Keychain on Mac to encrypt arbitrary data and associate it with a specific OS user, AIR application ID, and publisher ID. That means applications can encrypt and store data that only the current user and the current application can decrypt. And the best part is that it's extremely easy to use:

// Writing encrypted information
var passwordBytes:ByteArray = new ByteArray();
passwordBytes.writeUTFBytes("secretPassword");
EncryptedLocalStore.setItem("password", passwordBytes);

// Reading encrypted information
var passwordBytes:ByteArray = EncryptedLocalStore.getItem("password");
var password:String = passwordBytes.readUTFBytes(passwordBytes.length);

To make using the EncryptedLocalStore even easier, my team has written a Preferences API on top of it which makes it extremely easy for applications to store either encrypted or non-encrypted user preferences using any serializable data type.

Whether you use our Preferences library or the EncryptedLocalStore directly, I really think the ease with which sensitive data can be encrypted and decrypted will encourage developers to build secure and user-friendly AIR applications.

Posted by cantrell at 7:18 AM. Link | Comments (8) | References

November 30, 2006

Fun with Flex Data Binding

I'm working on a new Apollo application, and I've been having some fun with data binding in Flex. In case you haven't used data binding yet, it is simply a way to bind an object to a component so that changes to that object are automatically picked up by that component, and the component automatically updates itself appropriately. Here's a simple example (not valid MXML, but you get the point):

[Bindable]
private var labelText:String = "This is a label";

<mx:Label text="{labelText}"/>

Now that labelText is bound to the label component, anytime the labelText variable changes, the text of the label automatically changes, as well.

Ok, that's a basic example. Here's a more interesting usage:

[Bindable]
private var items:ArrayCollection;

<mx:Label text="You have {items.length} items."/>

All I'm doing in the example above is combining bound data with a static string so that the label will always show the current number of items in the ArrayCollection. The beauty of data binding is that is saves you the trouble of updating components manually when certain events occur. You just focus on the logic of your application (adding and removing items from the ArrayCollection, in this case), and the label just takes care of itself.

Here's a slightly more interesting example:

<mx:TextInput id="myInput"/>
<mx:Button label="Do Something" enabled="{myInput.text.length > 0}"/>

This is an example, I'm binding an expression to a component attribute. The length property of the text input is bindable, so whenever it changes, the expression that I've bound to the enabled attribute is evaluated. If the length is greater than zero, true is returned, and the button is enabled, but if the length is zero (meaning nothing has been typed into the text input), the button automatically disables itself.

Let's take this one step further:

private function isButtonEnabled(someString:String, itemLength:uint):Boolean
{
	if (...) {
  		myButton.label = "I'm enabled!";
  		return true;
  	} else {
  		myButton.label = "I'm disabled.";
  		return false;
  	}
}

<mx:Button id="myButton" enabled="{isButtonEnabled(someString, items.length)}"/>

In this example, I appear to be binding a function call to the enabled attribute of the button, but in fact I'm actually binding someString and the length property of items to the button. Whenever either changes, the entire expression is evaluated, which causes my function to be called. The arguments of my function call are basically just an arbitrarily long list of objects that my button may be interested in, and may not even be used in the function itself to decide what to do or return. Another advantage of this approach is that my function may do more than just return true or false. I can change the label of the button, or do any number of other things that are appropriate for the current state of the application.

There are a lot of other fun things that can be done with data binding, but I'm not going to go any further because I haven't decided where to draw the line yet between using data binding to its full potential, and abusing it. That said, if you have any good data binding tips or tricks, I'd love to hear them.

Posted by cantrell at 10:17 AM. Link | Comments (19) | References

September 22, 2006

Integrating Perforce with Flex Builder

Personally, I'm a Subversion fan. I started off using CVS for version control many years ago, then moved to Subversion, and have since been perfectly happy. But the Apollo team (along with most other teams at Adobe) uses Perforce, so I've been having to adapt. I actually like Perforce in general, but there are two things that really bother me:

  1. I don't like how you have to check files out (or add them to a changelist) before you can edit them. It's really annoying to stop what you're doing, switch to the P4Win client, and add a file to a changelist every time you want to edit it. It really interrupts my workflow.
  2. The P4Win client is kind of slow, and not the most intuitive and usable interface I've ever used. And that little jogging P4 icon was certainly an interesting choice.

Anyway, enough complaining. I decided I needed to make working with Perforce easier, so I tried installing the Perforce Eclipse plugin into Flex Builder 2, and was pleased to discover that not only does it work fine, but it really makes working with Perforce much easier and much more efficient. Now, when I want to edit a file, I can add it to a change list right form Flex Builder with a single click.

You can find out how to install the Perforce plugin here. To start using Perforce from Flex Builder, right click on a project, go to "Team", and select "Share project...". In the port field, enter the server and port in the format "server:port" and you're all set.

Posted by cantrell at 11:00 AM. Link | Comments (5) | References

March 1, 2006

Free, Open-source ActionScript 3.0 Libraries

We just released a set of free, open-source ActionScript 3.0 libraries to help get people going with the Flex Builder 2 beta. The libraries include the following projects:

All the libraries are well documented and come with unit tests. You can download the source and/or just the SWCs, and do anything you want with them (the license is very liberal). All I ask personally is that you build something cool and send me the link.

We built a pretty nice mash-up called "Flow" using five of the seven libraries last week. Kevin Lynch showed it during the Flashforward keynote, and we should be releasing it (along with the code) within the next week or so.

Posted by cantrell at 10:48 AM. Link | Comments (4) | References

January 31, 2006

Flex Beta 2 and Free Flex SDK

It's all true. We've decided to release a free version of the Flex SDK. We haven't decided exactly what's going to be in it yet, but at a minimum, a compiler and the framework -- everything you need to build Flex 2 applications. We're also going to release a free version of Flex Enterprise Services that will be limited by the number of connections it allows, and will only run on a single server. Of course, Flex Builder 2 and the full version of Flex Enterprise Services 2 won't be free, but now anyone will be able to get started building Flex 2 applications at no cost whatsoever. This is all we really know at this point, but I'll post more details when I have them.

Also, Flex Builder 2 and Flex Enterprise Services 2 will go into public beta tomorrow, so get ready. Some of the new features include:

If you're still getting up to speed on Flex, I made a post the other day entitled "Clarifying the Term Flex" which describes in detail all the different components of Flex. I'll let you know when the beta is available for download, or you can just keep an eye on Adobe Labs (rss).

Posted by cantrell at 3:21 PM. Link | Comments (11) | References

January 19, 2006

Clarifying the Term "Flex"

I've noticed some confusion out there around the term "Flex". The term has evolved as our technology has evolved, and actually means something very different now than it did even just a few months ago. If you're a little confused about what we mean when we say Flex or Flex 2, this should clear things up.

I've decided to break this post down into two sections: Initial Flex Products, which describes how we started off using the term Flex, and Current Flex Products, which describes what Flex means today.

Initial Flex Products

Current Flex Products

Other Flex-related Technologies

If you have any Flex related questions, or if anything in this post isn't clear, let me know.

Posted by cantrell at 9:55 AM. Link | Comments (19) | References

January 17, 2006

A Ruby Script for Compiling Flex Applications

There have been a lot of posts recently about how to compile Flex applications and ActionScript projects from the command line (on Windows, Mac, and Linux).  Mike Chambers has a nice summary which points to all the information you need to get going, and has a bash script which wraps the mxmlc compiler to make compilation easier.

I have some specific compilation needs, however, so I decided to write a Ruby script to wrap the mxml compiler (I'm not a huge fan of bash once my scripts reach a certain level of complexity). Once you have the Flex environment set up, just download the script, make sure it's in your path, configure it, and you can compile like this:

% mxmlc.rb MyApplication.mxml

The script has the following flags:

Before running the script, you have to configure it by defining the following variables at the top:

Let me know if you have any problems getting it to run. It was written and tested under Ruby version 1.8.2 which should already be installed on your Mac. To get the alpha version of the Flex Framework and the compiler, check out Flex Builder 2 on Adobe Labs.

Posted by cantrell at 8:59 AM. Link | Comments (3) | References

January 9, 2006

ActionScript 3.0 Presentation and Examples

Back in November, Danny Dura and I did a small world tour  to talk to our international communities about ActionScript 3.0.  Danny did Europe, and I did Asia. We put together a PowerPoint presentation (which you can view here), and several good code examples (which you can download here).  The presentation covers:

To run these examples and build your own Flex 2.0 applications, you'll need to grab the Flex Builder 2 alpha from Adobe Labs.

Posted by cantrell at 10:10 AM. Link | References

November 10, 2005

CFEclipse and Flex Builder 2: Happy Together

I now do all my Flash development in Flex Builder 2. No exceptions. But I still use another installation of Eclipse for other types of development (ColdFusion, Java, HTML, JavaScript, etc.). Yesterday, I ran into a situation where I needed to embed a small Flex application in a custom HTML page, so tried installing CFEclipse into Flex Builder 2, and it seems to work perfectly. It's not guaranteed to work, and I supposed it could break in the future, but for now, I'm a very happy developer.

Update: I should qualify that I'm talking about the standalone version of Flex Builder 2. The plugin version will definitely work with CFEclipse.

Posted by cantrell at 9:56 AM. Link | Comments (5) | References

October 10, 2005

Video of Flex Announcement at Web 2.0

Although you've probably already seen the Flex 2.0 product family announcement, you can now see a video clip of Kevin Lynch actually delivering the official announcement at Web 2.0. Mike Chambers got Kevin's entire presentation on tape. It's only about 15 minutes long, but Kevin packs in a ton of good information, including building a very nice little application using Flex Builder 2 (Zorn) in only about 5 minutes. The clip is available as Flash video both on Mike's blog and on Google Video. If you get seasick, brace yourself for about the first 30 seconds, but after that, it stabilizes.

Posted by cantrell at 11:33 AM. Link | Comments (3) | References

October 5, 2004

Non-commercial Flex Licenses Now Available

Flex just became much more accessible. If you're a student, educator, or if you run a non-commercial, non-institutional website, you can now use Flex for free in a production environment. From Macromedia's site:

This software license will enable individuals, including students, technology educators and individual developers to build and deploy Flex applications at no cost (except for a small shipping and handling fee). Participants also receive 1 license of Macromedia Flex Builder, the Macromedia IDE for Flex.

Find out more (including exactly who qualifies) by reading the Flex FAQ.

Posted by cantrell at 10:33 AM. Link | Comments (4) | References

August 23, 2004

Flex Builder (aka Brady) Goes Live

If you're doing Flex development, you will be happy to hear that Flex Builder -- the Flex IDE we've been calling "Brady" -- is now live. There's tons of information about Brady on the site, which I'll link to below, but I'll give you the lowdown here to save you a few clicks.

Flex Builder is an IDE for developing Flex applications. It doesn't just do MXML syntax highlighting and provide things like tag insight, though; it's actually very tightly integrated with the Flex server and really streamlines Flex application development.

As you might have guessed, Flex Builder is for Flex developers, and really specializes in and focuses on Flex application development. It's not a general purpose IDE like Dreamweaver or Eclipse.

Flex Builder comes with Flex. The Flex Builder trial comes with the Flex trial, and five licenses of Flex Builder come with every Flex license. (If you already purchased Flex, don't worry -- you can still get your Flex Builder licenses. See links below.)

You don't need Flex Builder to build Flex applications. You can keep using Dreamweaver, Eclipse, Emacs, Vim, or whatever you like to use. If you're using WIndows for Flex development, though (Flex Builder is only available on Windows), you might want to give it a try. I saw a demo of it last week, and it will really make Flex developers' lives easier.

That's Flex Builder at a high level. For more information, see:

Posted by cantrell at 10:20 AM. Link | Comments (1) | References

August 5, 2004

Excellent Review of Flex

And by "excellent", by the way, I don't mean that it's unconditionally glowing. I mean that it's thorough, accurate, and objective.

In Peter Ent's review of Flex, he discusses the processes and challenges of building five very different applications using Flex with J2EE back-ends. For each application, Peter describes the project, provides links to screenshots and zip files containing the source code, and discusses the benefits and challenges of using Flex (along with other technologies like Flash Communication Server, and even the charting components from B-Line Express). At the end he provides a short analysis of Flex as an alternative to JSP, and summarizes the processes of coding in MXML, debugging Flex applications, and using style sheets with Flex. And, of course, he has a few comments on Flex documentation, as well.

This is one of the most honest, straightforward, and comprehensive reviews of Flex I've seen so far, and it's obviously written by someone who knows the technology he's working with. (It also doesn't hurt that it's relatively short and very easy to read, as well.) If you looking for a detailed, objective perspective on Flex technology, this is it.

Posted by cantrell at 10:00 AM. Link | References

July 14, 2004

Flex 1.0 Updater 2 Is Live

Just wanted to mention that the Flex 1.0 Updater 2 just went live. Lots of good stuff, according to the release notes. If you use Flex, get this update!

Posted by cantrell at 5:54 PM. Link | References

June 18, 2004

Curious About Brady?

Macromedia just published a new Logged In article with a lot of great information on Brady, Macromedia's new Flex IDE (which just entered final beta). It contains some pretty detailed descriptions, and several good screenshots. Here's a little taste:

Brady is the Macromedia IDE for Flex application development. Designers and developers can be more productive building Flex applications through tight integration between the IDE and the server. Developers can learn MXML and type code more quickly and accurately using Brady's code hinting feature. More visually-oriented programmers can use the drag-and-drop Design view to quickly lay out Flex interfaces and style them using CSS....

Posted by cantrell at 9:53 AM. Link | Comments (3) | References

April 9, 2004

Changing The Flex Preloader

I've seen a few people ask if there is any way to turn off the default preloader in Flex applications. You can do so using the "usePreloader" attribute of the Application tag, like this:

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" usePreloader="false">

But why turn it off? It's so nice! I can understand wanting to customize it, though, which you can do using the "preloader" attribute of the Application tag. For more information on customizing the Flex application preloader, search the Flex LiveDocs for the term "preloader" and you'll get all the information you need.

Posted by cantrell at 12:17 PM. Link | Comments (1) | References

April 1, 2004

Flex Trial Pricing for International Customers

There was a problem with the Macromedia online store which was causing international customers to be charged too much for the Flex trial CD. The issue has been resolved, so the price should once again be $8.99. Apologies to those who were affected. Please let me know if you have any other problems.

Posted by cantrell at 12:32 PM. Link | Comments (1) | References

March 29, 2004

Flex 1.0 is Live

Flex 1.0 has been released! There's no sense in me discussing it extensively here -- everything you will want to know is outlined on the Flex product page on Macromedia's website. I'll just say that I've been playing with Flex a lot for the last few days, and it's really amazing technology. I'm in Newton right now, immersing myself in Flex, which I'm loving!

Posted by cantrell at 9:49 AM. Link | Comments (3) | References

December 12, 2003

Flex - A Third Party Perspective

You've probably read all there is to read about Flex on Macromedia's site, and if you were at MAX, you heard plenty of discussion and saw plenty of demonstrations. Now check out what Java Boutique has to say about Flex.

Posted by cantrell at 9:46 AM. Link | Comments (4) | References

November 17, 2003

Royale is Now "Flex"

Royale is now officially "Macromedia Flex," and is now officially in beta (interested in joining?). And Macromedia has officially hired Christophe Coenraets as the official Flex Evangelist. Lot's of official announcements, which you can read about in an official article on DevNet.

Now I'm officially off to MAX.

Posted by cantrell at 8:20 AM. Link | Comments (8) | References

Copyright © 2009 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).