2
Is there any method of converting a JSON object to an XML object using the actionscript-3 with Flash CS6?
2
Is there any method of converting a JSON object to an XML object using the actionscript-3 with Flash CS6?
1
I was able to perform the conversion by creating this method that worked well:
function jsonToXML(obj:Object):XML {
    var to:XML = new XML(<root></root>);
    ad(to, obj);
    function ad(c:*, b:*):void {
       for(var a:Object in b) {
          if(b[a].toString() == "[object Object]") {
              c.appendChild(<{a}></{a}>);
              ad(c[a], b[a]);
          }
          else {
              c.appendChild(<{a}>{b[a]}</{a}>);
          }
       }
    }
    return to;
}
Browser other questions tagged json xml actionscript-3 type-conversion
You are not signed in. Login or sign up in order to post.
it seems that you do everything alone here at SOPT kkkk
– Tuyoshi Vinicius