Hello
I am new to Flash Remoting and Flash 2004 pro so probably my question will
sound stupid but anyway.
I am trying to develop a simple Flash 2004 Pro app with data coming From Ms
SQL Server via Flash Remoting for .NET. I have built a form with DataGrid and
started playing with the code. When I place the script that connects to the
service and populates the DataGrid in Layer1:1 frame without any event handlers
like ?load?, everything works fine. If I put the same script inside any kind of
event: ?load? for the screen or ?click? for a button I am not getting anything
from RelayResponder. Basically neither result nor fault handlers of my
RelayResponder fire when data is received (checked in the NetConnection
Debugger). Am I doing something wrong?
function whenClicked() {
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
import mx.remoting.RecordSet;
mx.remoting.debug.NetDebug.initialize();
var aspxService:Service = new
Service("http://localhost/flashremoting/gateway.aspx", null,
"flashremoting.test", null, null);
var pc:PendingCall = aspxService.getUsersList();
pc.responder = new RelayResponder(this, "gotResources", "gotResourcesFault");
function gotResources(re:ResultEvent):Void {
var rs:mx.remoting.RecordSet = mx.remoting.RecordSet(re.result);
rs.setDeliveryMode("onDemand");
this.gridUsersList.dataProvider = rs;
this.gridUsersList.selectedIndex = 0;
}
function gotResourcesFault(fe:FaultEvent):Void {
mx.remoting.debug.NetDebug.trace({level:"Debug", message:"Error Getting
Resources"});
}
}
this.ShowAllUsers_cmd.addEventListener("click", whenClicked);
Thanks in advance for any help.
Vlad