I made the TextField undo component. Add this component to any Flash or Flex application and all your text components will have undo and redo. This has been open sourced and is on http://code.google.com/p/undo-textfields/.

Instead of making different Flex and Flash components to use in place of the available components, I made one that adds undo to existing text components. It should work in Flash and in Flex, though I just have a Flex example to show you today. You can see that it can be container specific, though you would probably just put it on the root of your application or the stage. Type in the text components in the top panel. Then do the same in the bottom. You should be able to press Ctrl+Z and Ctrl+Y (or Ctrl+Shift+Z) to undo and redo. If you’re on a Mac just substitute Ctrl with Cmd. I’ve only tested it in Safari and Firefox on a Mac. I hope the key command work on other machines without issue. But I also added a couple of menu items to the right-click context menu. Give it a whirl below, view the source, and see how easy it is to add text undo and redo to all your existing applications without any refactoring.

Update: The keyboard shortcuts don’t work in the ActiveX version of Flash (Internet Explorer on Windows).

Let me know if the key-shortcuts don’t work on your system. Maybe phase 2 can be some javascript magic to capture those better.

By the way, i have added custom commands and events in order to create a code editing component (with syntax highlighting) as part of a simple IDE for a simple programming language used for educational purposes in greece.

If anyone is interested for the code just mail me :
sstergou ΑΤ gmail DΟΤ com

I haven’t added support for right-click paste. I only suggested it might be able to be supported in a recent version of the player, but I’m unsure.

If you’re sharing your code you should open source it and put it up on github or Google code. I’m sure a lot of people would be interested in at least looking through it and learning a thing or two, even if they don’t need a simple IDE.