Copy link to clipboard
Copied
Gidday
I have json data returning from my server, and then I decode it.
In php, I have unique names for the array sent back based on the result of the transaction...
$returnArray['links'] = $links;
$returnArray['msg'] = 'no matches for that code or name';
$returnArray['error'] = '3555';
(only one will ever be sent back at once)
In as3, I want to set up a switch based on the key name of the returned object...
switch (returnedServerData.nameofit-eg-links-or-msg-etc)
...so that I can set up my processing based on whether it's an error, link, msg etc
What do I type after returnedServerData. to access the name of that key?
Thanks guys
you can use:
for(var s:String in returnedServerData){
switch(s){
.
.
.
}
}
Copy link to clipboard
Copied
you can use:
for(var s:String in returnedServerData){
switch(s){
.
.
.
}
}
Copy link to clipboard
Copied
Ooo - that did the trick - thanks kGlad.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now