Hi,
I'm using Flash Remoting and everything is great...except...
I'm receiving the data back from the CF component in the _result handler, and giving it a name e.g.
getremotedata.cff_getdirreports({var_nt:+_root.NTname});
function cff_getdirreports_result(dirreps)
{
trace(dirreps.items[0].first_name);
}
Within the handler I can do what I want, however, I want to use "dirreps" OUTSIDE the handler, like so...
function cff_getdirreports_result(dirreps)
{
// do some stuff inside the handler
trace(dirreps.items[0].first_name);
// now call a submovie
tellTarget("mc_submovie")
{
gotoAndPlay(2);
}
}
Frame 1 of mc_submovie contains
stop();
Frame 2 of mc_submovie contains
trace(_root.dirreps.items[0].first_name);
But on this trace I get "undefined". I've tried various different things, but i can't seem to make the result (dirreps) visible outside the result handler. Am I doing something wrong or is this a limitation and if so, is there a way around it?
I don't have much hair as it is and me ripping out the remainder is upsetting my wife!
Cheers
Phil
P.R. Newman - 28 Jan 2004 15:59 GMT
> Hi,
>
[quoted text clipped - 10 lines]
>
> Within the handler I can do what I want, however, I want to use "dirreps" OUTSIDE the handler, like so...
Just copy dirreps into a global variable:
function cff_getdirreports_result(dirreps)
{
_global.reports_rs = dirreps;
trace(reports_rs.getItemAt(0).first_name);
}
trace(reports_rs.getItemAt(0).first_name);

Signature
Paul
-------------------------
Team Macromedia Member for Central
http://www.macromedia.com/go/team/
Extending Knowledge, Daily
http://www.communitymx.com
-------------------------