Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

Spelling Plus Library 1.1 Released for Flash, Flex, AIR

Today we’re releasing version 1.1 of our spell checking engine for ActionScript 3. Version 1.0 of Spelling Plus Library has been available for three months, and has been well received, with very positive feedback from our users. Amazingly we’ve only had a single bug report, and that turned out to be an issue with the Flex framework, rather than our code.

We have had a couple of feature requests, and came up with a few ideas of our own, which version 1.1 of the component addresses. Specific additions include:

  1. ability to turn off spell checking for the currently selected word (ie. so that it doesn’t flag a word as misspelled while you are still typing it).

  2. automatically enable/disable spellchecking on a target text field when it is focused / unfocused.

  3. better integration with Flex data binding.

We’re very committed to maintaining Spelling Plus Library as the best of breed spell checker library for Actionscript (Flash, Flex, AIR). It’s kind of nice to be able to provide support directly, unlike all of our previous components (ex. glic/mCOM and the Flash CS3 components). It means we can ensure the support experience for our users is as exceptional as the code behind the component.

You can visit the Spelling Plus Library product page for demos and more information.

Existing users: SPL 1.1 is a free release, expect your upgrade information within the next day.

ProximityManager updated for AS3

A few years ago, I released an AS2 version of ProximityManager class, which allows you to efficiently track the proximity of large numbers of sprites. You can read a full description of the approach and uses here.

In the last month a couple of people have left comments indicating that they were having difficulty porting it to AS3. This prompted me to port it and do some significant optimizations. The new class runs a lot faster than the original, and is worth taking a quick look at in comparison with the AS2 version even if you don’t use it in a project.

Optimizations:

  1. removed two-dimensional arrays (which are very inefficient, especially in AS3) in favor of using a single array using an aggregate x/y index. The aggregate index is assembled with bit operators to make it even more efficient.
  2. added a simple caching mechanism, so that subsequent calls to getNeighbor for the same grid position do not need to recalculate the results
  3. used a Dictionary instance to hold managed items, which makes it much more efficient to remove objects on the fly.
  4. took full advantage of types and casting
  5. other minor tweaks

Note that these optimizations impose a limit of +/- 1024 rows and columns on the ProximityManager. This shouldn’t be an issue though: even with a gridSize of only 25 pixels, you would still have an area of 51200 pixels wide and high to work with.

Continue reading →