Page 1 of 1

Database/sendResponse problem

Posted: 15 May 2009, 11:59
by Kenn
Hello!

Ive been playing around with the internalDbExample.fla files, trying to understand it. I managed to understand most of it, and altered it to fit my needs.

Problem is i dont really understand how to read the values that i send back to the client. Putting the values into the datagrid component as in the tutorial is no problem, but i just cant figure how to use the response object for anything else..

To put it short, how do i trace the content of the response? :oops:


Cheers!

Posted: 15 May 2009, 14:48
by Kenn
I must be stupid, but i really cant get this to work :/ ..

trace(o._cmd); works fine, traces the current value, however trace(o.list); returns nothing (" "), but it populates the datagrid component with the corrent values..

Surely there must be some way to use the data outside the datagrid component?

Posted: 15 May 2009, 20:03
by BigFIsh
o.list would output nothing because it's an object.

do this

for (var i in o.list)
{
trace(i ": " + o.list);
}

then to access these values, use o.list["name"] or o.list.name

Posted: 16 May 2009, 09:05
by Kenn
Thanks for the reply! Sadly it gives me the exact same thing, only now it gives me the right amount of rows.

output:
0:
1:
2:
3:
This is really confusing :/ ..

Posted: 16 May 2009, 09:30
by Kenn
Aha, found the problem, the column name had to be in caps..

trace("Name: "+o.list[0].NAME) instead of trace("Name: "+o.list[0].name)