Finally! Undo in Flash/Flex TextFields

One of those things that the browser has built in that you wish would just work in Flash – a simple TextField undo & redo. My brother recently released a really slick solution to the problem. It isn’t a UI component – it sits above the display list and works with all types of Flash TextFields: Flex components, Flash components, bare naked TextFields. It’s really small (1 manager and 3 command classes) and you attach it to the highest level display object necessary for a custom level of influence – so if you want the whole app to be effected then you attach it to the root.

Here’s what the API looks like:

var undoTextFields:UndoTextFields = new UndoTextFields();
undoTextFields.target = this;

Boom! done. (sound effect not included) And it works just like the browser – each TextField has its own undo/redo independent of the others.

NOTE:
The component uses the Flight Framework history without adopting the rest of the framework methodology. A great use of Flight, as it prescribes utility and a minimalistic approach to development. I’ll probably demo this utility at my upcoming presentation.

3 thoughts on “Finally! Undo in Flash/Flex TextFields

  1. Pingback: Undo and redo in ActionScript textfields, a bunch of Words, punctuated - by Paul Robertson (http://probertson.com/)

  2. Pingback: localToGlobal » Blog Archive » news review -> 7th week of 2009

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>