<?xml version="1.0" encoding="utf-8"?>
<gui:RCPModule xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:gui="cn.smartinvoke.gui.*"
xmlns:rcp="cn.smartinvoke.rcp.*"
layout="vertical" horizontalAlign="center" verticalAlign="middle" creationComplete="init()">
<mx:Script>
<![CDATA[
import cn.smartinvoke.smartrcp.gui.FlashViewer;
import mx.collections.ArrayCollection;
import cn.smartinvoke.smartrcp.gui.control.ViewManager;
function init():void{
var info:String="本模块演示模块之间调用功能,smartrcp默认将模块所在类的方法设置
为公共的,以便别的模块进行调用" +
",我们在这里展示调用左边功能导航模块的setStatusText方法";
smartrcpDemo.Instance.setInfo(info);
}
function onSend():void{
//获得视图管理器
var viewManager:ViewManager=ViewManager.Instance;
//获得功能列表的FlashViewer
var flashViewers:ArrayCollection=viewManager.findFlashViewers
("views/TreeViewPart.swf");
if(flashViewers!=null && flashViewers.length>0){
var flashViewer:FlashViewer=flashViewers[0] as FlashViewer;
flashViewer.invoke("setStatusText",[this.infoText.text]);
}
}
]]>
</mx:Script>
<mx:Panel title="视图调用部分,调用功能列表模块中的方法" cornerRadius="0" paddingLeft="0"
paddingRight="0"
styleName="opaquePanel" width="100%" height="100%">
<mx:Label text="输入信息"/>
<mx:TextArea width="50%" height="100" id="infoText">
</mx:TextArea>
<mx:Button label="发送" click="onSend()"/>
</mx:Panel>
</gui:RCPModule>
本篇演示smartrcp的模块调用功能
最新推荐文章于 2010-06-19 21:00:52 发布
本文展示了模块间如何调用功能,通过实例演示了如何使用Flash Viewer的setStatusText方法,涉及GUI模块和视图管理器的交互。
615

被折叠的 条评论
为什么被折叠?



