ActionScript spell-checking with Squiggly – AS3 only and Flash 9 compatible

Some days ago Adobe released the spell-checking library called “Squiggly“. According to Adobe the library “allows you to easily add spell checking functionality in any Flex 3 based text control” – but because most of our projects are AS3 only, we decided to build a class which allows you to use the SpellChecker’s functionality with every normal TextField in Flash.

Unfortunately Adobe messed up the Docs of the library’s current version (BTW, why do we need to download it? every other doc is accessible online) – they are talking about Events and EventDispatcher where no Dispatcher can be found and not even one Event is fired. Great that Adobe releases such a tool but they should definitely try to get the facts/info/docs right! Otherwise it’s really hard for us developers to work with (and maybe improve) the tools they offer.

So here is the first version of our spell-checker for ActionScript 3 / FlashPlayer 9. Currently there is only error-highlighting, the other features will hopefully come within the next few days (suggesting and replacing words).

Try it for yourself …

It is as easy as this:

import com.apdevblog.text.spelling.ApdevSpellChecker;
// ...

// create + add new TextField
var txt:TextField = new TextField();
addChild(txt);

// create new SpellChecker and set TextField as target
// second parameter is the URL to the dictionary
var url:String = "data/usa.zwl";
var checker:ApdevSpellChecker = new ApdevSpellChecker(txt, url);

You can grab version 0.1 of our ApdevSpellChecker class here: ApdevSpellChecker.as
… and check the example here: /examples/apdev_squiggly/
More info about Squiggly here: http://labs.adobe.com/technologies/squiggly/

cheers

Comments