I’ve completely re-written my ActionScript function. For those who are hearing about it for the first time ActionScript(Object, ‘name_of_the_variable’) – gets complete reusable actionscript string of the Object including circular references.

Now it takes care of special characters in properties and also shows null values properly
Now the actionscript produced is more readable. See the following example for better understanding.

[cc lang=”actionscript3″]#includetoString.as// var x ={a:null,b:undefined} x.obj ={} x.obj[“special#.“]=true trace(ActionScript(x,’x’)); [/cc]

It Produces the following output
[cc lang=”actionscript3″]x = { obj:{}, a:null, b:undefined } x.obj[“special#.“] = true; [/cc]

You can download the toString.as from the actionscript section of this blog.