What’s the best way(s) to implement a “cancel” button feature (say for a dialog which uses some shared model & two way bindings)?
The obvious solution of copying every field in the object into a “revert” obj defeats the purpose (might as well just set each value manually upon a save). I’ve used ObjectUtil.copy/clone in the past, but I’m not aware of all the caveats with more complex data types which contain lists, etc. (Deep vs. Shallow copy)
Are there any better/other methods?
Please read AS3 – Clone an object
For complex Value Objects will be good using the ByteArray class for creation clone.
But make sure that you are using [RemoteClass] or registerClassAlias for all classes that you what to clone.