Saving Cloned Objects

Saving dynamically created objects

Sunday, February 11, 2007 by whiterabbit007 | Discussion: DesktopX

I'm creating a widget that based on some actions of the user creates new objects, I do this by cloning a template object that is hidden. The problem I'm having is that when I close the widget, it doesn't remember all those new objects it created and when I open it again they are gone.
Those objects, while not very complex, do have a number of parameters that they need stored and so using something like Local/PersistStorage to save each object's parameters and then essentially recreate them when the widget runs again seems awfully inefficient. Is there a way to save the state of the widget together with all its children (the new objects are parented to the main object)? Or perhaps I can store an entire object in local storage, is that possible?
whiterabbit007
Reply #1 Thursday, February 15, 2007 7:37 PM
So does nobody have any suggestions or ideas?
BigDogBigFeet
Reply #2 Thursday, February 15, 2007 7:51 PM
I've never tried something like that but, have you tried experimenting with giving the widget and all its children the same widget name as displayed on the summary tab loacted on the porperties panel and then executing a save widget command in script. It seems logically that would work. But as a practicle matter I don't know how that could be scripted (the save widget command) Vad_M would probably know how. Try sending him an email.  
Vad_M
Reply #3 Thursday, February 15, 2007 8:24 PM
I see a single way to do this. Your "Main" widget must create the "INI" file where it can save all information about cloning objects (their count, position etc...) before its closing. You need use File System Object (FSO) for this. In this case your widget will read this file at the next start and clone the same objects.

Have a Nice Day.  

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01