Jump to content
Search Community

What's the best way to Save a transform + display objects?

sonicworks test
Moderator Tag

Recommended Posts

Hi,

 

 

I have a panel area that a user can add images and text to and transform to their hearts content. Great!

I can save and load the transform data using the exportFullXML() and then applyFullXML() etc.. Superb! great for undo/redo

 

This obviously just saves the transform data not any info and the actual display objects ie. the Image source, text data and properties etc..

 

My question is... What's the best way to save this data as well to be reloaded?

 

I could create another array that gets added to the xml output of the transform xml but I'm not sure of the best way to link the 2 sets of data (display object on stage to the transform item list). The 'name' may not be unique (unless I force it to be maybe?) and the stage objects don't seem to have any transform 'level' property

 

How can I link the textBox data properties with the transform data?

 

[using Flex 3.5]

 

Hope that make sense to someone

 

Cheers

 

Tim

Link to comment
Share on other sites

Yeah, it seems to make sense to base things on name since that's what's stored in the exported XML and since XML can only reference String data anyway (as opposed to actual objects), that's safest. But you can really do whatever you want - I'm not sure there's a need to handle the transform data and whatever other data you're wanting to save in the same way. They could be completely distinct. Just make sure you applyFullXML() and apply your data in whatever way you want before you present it to the user. That may be as clear as mud, but hopefully it's somewhat helpful :)

Link to comment
Share on other sites

Hi,

 

Ye,s in he end I created a unique reference for the display objects name. (using this class http://www.rgbeffects.com/blog/developm ... rs-in-as3/)

 

I can then tie together my array of display object properties with the transformer XML item names export and combine into one XML for saving. As the reference the 'name' property is unique.

 

It seems to work ok, it just feels like there should be a more straight forward way.

 

Thanks

 

Tim

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...