开发者

ActionScript - General Undo / Redo API?

i've been unsuccessfully attempting to create my own undo/redo classes that work well with any type of possib开发者_Python百科le undo and redo commands.

for example, my simple class works perfectly with undoing/redoing x and y positions of display objects or undoing/redoing values of sliders, etc., but things get dicey when i try to tailor my classes to also work with things like adding and removing items to a list.

is there any well known and well documented solution for general undoing and redoing for actionscript (without Flex)?


There are specific design patters for this kind of stuff in AS3

Please check the following links: http://lucamezzalira.com/2010/01/12/memento-pattern-in-actionscript-3-undoredo/

you can also check Command pattern, which is the de-facto standard ,irrespective of the programming language, it would give you the basics.

Incase you face any issues, please feel free to comment.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜