Hello,
I had call a process in my flex application? I was wondering how can wait unit the process is finished?
for example, I have following code in a class called loadMember:
private var loadMemberById:RemoteObject = new RemoteObject(PROCESS_LOAD_MEMBER);;
private var memberId:String;
public function LoadMemberManager(id:String)
{
this.memberId = id;
loadMemberById.channelSet = ChannelSetHelper.getRemoteObjectInstance().channelSet;
loadMemberById.addEventListener(ResultEvent.RESULT,handleResult);
}
public function load():void
{
var params:Object=new Object();
params[MEMBER_ID]=memberId;
loadMemberById.invoke(params);
}
// This method handles a successful conversion invocation
private function handleResult(event:ResultEvent):void
{
//Retrieve information returned from the service invocation
var res:Object=event.result;
var member:MemberDTO=res[MEMBER] as MemberDTO;
}
in a method of another class, I do following
var load:loadMember=new loadMember(memberName);
load.load();
//do something here
How can I wait load.load() to finished until do something?
Thanks,
Views
Replies
Total Likes
Use an asynchronous request. When invoke is dispatched on an asynchronous request you can store the responder to call later.
See http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/mx/rpc/AsyncRequest.html
Steve
Views
Replies
Total Likes