PDA

View Full Version : assign result to variable to use later?


heyder
07-16-2003, 02:01 PM
Wondering if I want to use the results of a "service call" (is that the right terminolgy?) later in a script do I need to assign it to a variable or does it already get stored as something?

ie...


function getPeople_Result(result) {
peoplelist=result;
}




trace(peoplelist.items[0].name);

freddycodes
07-16-2003, 03:46 PM
Since the returning object is a argument to the result handler, its scope is only valid in the result handler. Basically yes you need to assign it to a variable that can be accessed outside the function in order to use it later.

heyder
07-16-2003, 06:31 PM
Thanks again.