2011-12-22 74 views

回答

0

我用这一点,下面是该语法。

<mx:RemoteObject id="roTestQuestion" destination="GenericDestination" 
    source="FlexDataLayer.BusinessLogic.TestQuestionBLL" showBusyCursor="true" fault=" {onFault(event);}"> 
    <mx:method name="GetList" result="{roTestQuestion_GetList(event);}" /> 
    <mx:method name="GetAnswerList" result="{roTestQuestion_GetAnswerList(event);}" /> 
    <mx:method name="Insert" result="{roTestQuestion_Insert(event);}" /> 
    <mx:method name="Update" result="{roTestQuestion_Update(event);}" /> 
    <mx:method name="Delete" result="{roTestQuestion_Delete(event);}" /> 
    <mx:method name="GetListByCategoryID" result="{roTestQuestion_GetListByCategoryID(event);}" /> 
</mx:RemoteObject> 

源是你的.NET类,你需要创建一个方法,我写错误和结果。

的故障

private function onFault(e:FaultEvent):void 
{ 
Alert.show(e.fault.message.toString(),parentApplication.alertTitle);  
} 

的结果

private function roTestQuestion_Delete(e:ResultEvent):void 
     { 
      if (e.result!= null) 
      { 
       if(cbCat.selectedIndex == 0) 
       { 
        roTestQuestion.GetList(); 
       } 
       else 
       { 
        roTestQuestion.GetListByCategoryID(selIndex); 
       } 
       //roTestQuestion.GetList(); 
       //Application.application._mdlExamSelection.Init(); 
      } 
     } 

这里我给打电话从RemoteObject该方法的方法。

roTestQuestion.GetList(); 

您是初学者,所以我建议你去通过下面的链接,因为在未来ü需要使用ActionScript而这个链接将要对你非常有用......

请访问这Link

+1

感谢萨格尔拉瓦尔, 我会尝试这一点,并告诉你,如果我得到任何问题。 – 2011-12-22 08:44:55

+1

没问题。我相信你不会去解决任何问题。 – 2011-12-22 08:47:28

+1

感谢卓越的工作sagar ....它帮助我很多 – 2012-01-07 06:30:58