Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by cintia ( 13 years ago )
catalogJson=JSON.decode('{"categorias":{"1":{"id":"1","nome":"Bebida","pai":"0","referencia":"1"},"2":{"id":"2","nome":"Comida","pai":"0","referencia":"2"},"3":{"id":"3","nome":"Com Alcool","pai":"1","referencia":"1;3"},"4":{"id":"4","nome":"Sem Alcool","pai":"1","referencia":"1;4"}},"produtos":{"1":{"id":"1","titulo":"Brahma","idCategoria":"3","descricao":"Lata!","preco":"3.50","informacoes":""},"2":{"id":"2","titulo":"Coca-cola","idCategoria":"4","descricao":"Lata","preco":"2.50","informacoes":""}}}');
   
   

   for (var keys:Object in catalogJson) { 
     
    var category:Object=catalogJson[keys];    
    
    
    for (var key:Object in category) {
    
    var id:Object=category[key];
    
     trace(id.nome as String);
    
    }    
 
   }

 

Revise this Paste

Your Name: Code Language: