Yes, command based. If you were to follow Omar's version you could end up
with a memory hog. Imagine a 4000 character text field/document. Storing a
snap shot if that x20 is overkill in a bad way.

Copy/Paste/Delete are all fairly simple. You might want to enhance your undo
feature when you type. If a capture is made for every key stroke then you
would quickly spend all your undos on a sentence. You should consider
bundling like commands (such as typing) into a single command. Look at
typing like adding characters to a paste command.

For example, if you were to type a whole sentence and then UNDO, the whole
sentence would be removed. But if you type most of the sentence and then
paste text and then finish typing the sentence, you would end up with 3
commands (latter part of the sentence, paste, first part of sentence).

You might also consider having the backspace count as a different command
than typing alphanumeric characters. You could also look at the Enter
command as a different command than alphanumeric as well. Both of these make
natural breaks in command groups.

Charles P.


On 9/3/07, dr.ache <[EMAIL PROTECTED]> wrote:
>
> Command done on the text! A command representing the action and the
> amount, like cut from location 3 to 24 of the text.
> The text you cut of must also be saved, certainly!
>
> James Marsden schrieb:
> > Hello all,
> >
> > I'm looking at building a very simple text editor application in
> > Flash, which needs an undo/redo stack of around 20.
> >
> > My question is related to capturing the events in the stack; whether
> > the done thing is to capture the state of the text field contents at
> > every step, or just to record commands that are operated on the text
> > field. For example, when cutting a piece of text, does the system
> > record the state of the textfield when the cut is made, or does it
> > just record the action and values related to it, ie. "cut /piece of
> > text/ from string position 344".
> >
> > Any advice from bods with experience in this area much appreciated!
> >
> > Thanks,
> >
> > James
> > _______________________________________________
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
>
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to