我试图在单个ActionScript方法上调用AMFPHP两次,发生的情况是只有第一次调用成功。第二个不会返回错误,不会提醒任何事情,更有可能它甚至不会发生,我不知道为什么。在netconnection上使用singleton模式对amfphp进行多次调用
下面是一个例子:
public function editSomething():void{
if(dgChild.selectedIndex == -1){
Alert.show("You need to select a register in order to edit it.");
return;
}
_parent1.getParentByChild(dgChild.selectedItem.id);
_parent2.getParent2ByChild(dgChild.selectedItem.id);
}
当调用此方法时,第一亲本通常被称为,但第二个是没有的。
变量_parent1和_parent2是对象与PHP通信,并保存结果:
public class parentDAO{
//Service or Class that this objectDAO will be communicating with.
private const _phpController:String = "parentController/";
private var _AMFPHP:AMFPHP = AMFPHP.getInstance();
//ArrayCollection that will be filled with data comming from PHP/Database.
[Bindable] private var _dataProviderAeronave:ArrayCollection;
//I use public getter and setter for this dataProvider
public function getParentByChild(child_id:int):void{
_AMFPHP.GATEWAY.call(_phpController + "getParentByChild", new Responder(resultGetParent), child_id);
}
private function resultGetParent(result:Array):void{
dataProviderParent = new ArrayCollection(result);
}
}
现在,假定可变_parent1以上声明一个对象和所述_parent2是另一个类的另一个目的非常非常类似于这一个,并假设这两个通信完美无缺,现在的问题就出现了:当我在一个单一的ActionScript方法中调用这两个方法时。如果我打电话给他们其中的一个,它将正常工作,但是当我打电话给两个服务时,第二个服务从来没有被实际调用过。我很确定,因为我可以通过Service Capture Proxy查看它。
任何想法?
_parent1和_parent2是从AMFPHP不同的服务。不同的类,不同的表等 – 2012-02-23 16:18:37