all groups > macromedia flash flash remoting > january 2004 >
You're in the

macromedia flash flash remoting

group:

_result query


Re: _result query P.R. Newman
1/28/2004 10:59:37 AM
macromedia flash flash remoting: [quoted text, click to view]
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);

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


_result query phil ashby
1/28/2004 2:44:52 PM
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





AddThis Social Bookmark Button