I working on a project where you take 2 different product combine them
and make 1. I'm using amfphp 1.9 and flash AS3. I'm able to bring 1
product in fine but the part I'm having troubles with is loading in the
second one. For AS2 I used
var pc:PendingCall = svc.getDepartment();
pc.responder = new RelayResponder(this,
"getDepartment_Result", "onError" );
var pc:PendingCall = svc.getArtDepartment();
pc.responder = new RelayResponder(this,
"getArtDepartment_Result", "onError" );
Which worked well. The part I'm wondering is how to approach this with
AS 3.
Can I take getProducts_btn.addEventListener(MouseEvent.CLICK, sendData);
rename it to getArtProducts_btn.addEventListener(MouseEvent.CLICK,
sendArtData); and then add another responder, refresh, and functions
for sendData and onResult? If I understand correctly, onResult is what
populating the datagrid. I tried to add another product_dg.dataProvider
= RecordSetDP.toDataProvider(result); in the onResult but I'm not sure
how(if possible) you would send a value to add an if statement to the
sendData function.to determine which connection.call to run. Does
anyone know of a solution or how to search for a solution for this? I
tried a couple of searches but only come up with a single item example.
Thanks for you time
Kevin
public function Main() {
getProducts_btn.addEventListener(MouseEvent.CLICK, sendData);
responder = new Responder(onResult, onFault);
refresh = new Responder(refreshData, onFault);
connection = new NetConnection;
connection.connect(gateway);
refreshData(true);
}
public function sendData(e:MouseEvent):void {
connection.call("DepartmentService.getProduct", responder);
}
private function onResult(result:Object):void {
product_dg.dataProvider = RecordSetDP.toDataProvider(result);
}
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders