xml - flash as3 and adobe air -- save drawing file with the ability to undo/redo afterwards -
i'm making adobe air drawing app using flash cs6. have save option lets undo/redo drawing line strokes after have saved , exited program , opened time.
i have researched bitmapdata, bitmap, sprite, file, , filestream, nothing came me way save ability undo/redo after.
by way, have made functions saving, opening, , reading file. have no idea on put in file being saved.
make class each line hold graphics object in it. on every stroke create instance of class , add array. on save (let's imagine save xml file) can make node < canvas >
store sub-nodes every line info.
on load read xml file , recreate array objects. order of xml node depth/z-index/layer order , history undo/redo.
if wish take further, let's undo color change of stroke, need make actionhistory class point action , object.
hope helps!
Comments
Post a Comment