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 Comments

  1. Posted on February 12, 2009 at 10:29 am by Undo and redo in ActionScript textfields, a bunch of Words, punctuated - by Paul Robertson (http://probertson.com/)

    […] here’s his introductory blog post about the “undo textfields” library. (via Tyler Wright via Gilles […]

  2. Posted on February 16, 2009 at 1:29 pm by localToGlobal » Blog Archive » news review -> 7th week of 2009

    […] > xtyler Finally! Undo in Flash/Flex Texfields […]

  3. Posted on October 6, 2009 at 4:20 am by Tahir Alvi

    I want to implement the drawing board to undo and redo the drawing by users.

The comments are closed.