动作 - 通用撤销/重做API? [英] ActionScript - General Undo / Redo API?

查看:100
本文介绍了动作 - 通用撤销/重做API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直不成功尝试创建自己的撤销/重做,与任何类型的可能撤消的正常工作类和重做命令。

i've been unsuccessfully attempting to create my own undo/redo classes that work well with any type of possible undo and redo commands.

例如,我简单的类能很好的撤销/重做x和显示对象或撤消y位置/重做滑块等的值,但事情变得冒险,当我尝试定制我的课也有像工作添加和删​​除项目的清单。

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.

有任何众所周知的的有据可查的解决方案一般撤销和重做的动作(没有的Flex)?

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

推荐答案

有具体的设计patters对于这种东西,在AS3

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

请查看以下链接: 的http://lucamezzalira.com/2010/01/12/memento-pattern-in-actionscript-3-undoredo/

您还可以检查Command模式,这是事实上的标准,不考虑编程语言,它会给你的基本知识。

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.

这篇关于动作 - 通用撤销/重做API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆