Undo and Redo thro ActionScript

Hello Friends,

I am making one application and in that application I would like to add Undo and Redo architecture as we have in most of the application. I and having problem where user deletes some portion of an image, adds some text, transforms an image and also do changes. now I want to undo that process and when that user is not satisfied he redo that till the process he thinks fits.

Thanks in advance