Flex 调用父组件的父组件中的方法
发布时间:2020-12-15 04:29:34 所属栏目:百科 来源:网络整理
导读:我在myDayReport.mxml中定义了一个用来刷新的方法: public function refresh_callbackHandler():void{pagingFunction(0,13);} 在myDayReport.mxml中点击新建日报会弹出一个窗口:AddReport.mxml。 在AddReport.mxml的ViewStack中包含了另一个窗口:AddRepor
我在myDayReport.mxml中定义了一个用来刷新的方法: public function refresh_callbackHandler():void { pagingFunction(0,13); } 在myDayReport.mxml中点击新建日报会弹出一个窗口:AddReport.mxml。 在AddReport.mxml的ViewStack中包含了另一个窗口:AddReport1.mxml。 我在AddRepot1.mxmxl中每当我保存信息后,我希望调用myDayReport.mxml中的refresh_callbackHandler方法。我可以这样做: 在AddReport1.mxml中定义了变量iparent public var iparent:Sprite; 然后在需要调用的地方写上: ((iparent as AddReport).iparent as myDayReport).refresh_callbackHandler(); 再在AddReport.mxml文件中定义变量: public var iparent:Sprite; 在AddReport.mxml文件中的ViewStack中需要指定iparent: <s:NavigatorContent width="100%" height="100%"> <view:AddReport1 id="addReport1" iparent="{this}" creationComplete="addReport1_creationCompleteHandler(event)" remove="next_removeHandler(event)"/> </s:NavigatorContent> 搞定 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |