Not sure what your loop looks like, but here's the simplest one I know:

               var o:Object = new Object();
               o.cost = 200;
               o.item_name = "Lemonade";
               o.list = "1,2,3";

               var s:String = "";
               for ( var param:String in o ) {
                   s += param + "=" + o[param] + "&";
               }
               trace( "s: "+s );

-Scott

On 3/12/07, Persaud, Anthony <[EMAIL PROTECTED]> wrote:

   I'm looking for an easier way to serialize a simple object. Any
suggestions? Example:



o:Object = new Object();



o.cost = '200';

o.item_name = 'Lemonade';

o.list = '1,2,3'



trace( serialize( o ) ); //cost=200&item_name=Lemondate&list=1,2,3



//(or what would be sweet would be something like : o.serialize() )



(right now I'm using for loops). Maybe someone knows a more efficient
shortcut and I haven't found out about it yet.



Thanks ahead of time,



Anthony




--

: : ) Scott

Reply via email to