The first thing to be aware of is circular object references, i.e. can you
recursively trace the array without crashing Flash.  So, linked lists are
out of the question.

The second is not to pass any object references (including methods) where
the referred object might change before it is written.  This can do that
trick:


function removeByRef(object:Object) {

   if(typeof(object) == "object") {
       var tmpObject = new Object();

       for(var i in object) {

           switch(typeof(object[i])) {
               case "object":
                   tmpObject[i] = removeByRef(object[i]);
                   break;

               case "function":
                   break;

               default:
                   tmpObject[i] = object[i];
                   break;
           }
       }
       return tmpObject;
   } else {
       return object;
   }
}
<<<

Basically the same rules as trying to serialize a Flash object into a SOAP
object during remoting.

Hello.

Are there any caveats to persisiting an array of shared objects?

My first attempt, which attempted to stick in one of those into a
FlashCookie failed, and Solve couldnt open the .sol file either.

I'm going to try this again, with just simple objects that have only the
fields, and no methods, but in the meantime, is there something else
that I should watch out for?

Thanks.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to