首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Flash >

smartinvoke入门系列九——窗口类型FlashShell与事件

2012-12-22 
smartinvoke入门系列9——窗口类型FlashShell与事件SmartInvoke使用cn.smartinvoke.gui.shell.FlashShell类

smartinvoke入门系列9——窗口类型FlashShell与事件

SmartInvoke使用cn.smartinvoke.gui.shell.FlashShell类管理应用程序打开的窗口,通过该对象,用户可以设置窗口的标题,位置,大小,是否可以,透明度等属性,还可以监听窗口的

CShellEvent.Event_Activated,CShellEvent.Event_Closed,CShellEvent.Event_Deactivated, CShellEvent.Event_Deiconified,CShellEvent.Event_Iconified事件。每个打开的窗口有且只有一个该对象,通过cn.smartinvoke.gui.SIApplication对象的shell属性可以获得该对象的句柄。

比如在First_项目的FirstWin.mxml文件中添加如下代码就可以实现关闭询问对话框的功能:

?

//添加关闭监听器

??????????? ?? this.shell.addShellListener(CShellEvent.Event_Closed,function(evt:CShellEvent):void{

??????????????? ?? Alert.show("do you want to exist!","select dialog",Alert.YES|Alert.NO,this,

??????????????????? ?? this.clickSelectHandler,null,1);

??????????? ?? },this);

?

private function clickSelectHandler(evt:CloseEvent):void{?

??????????????? if(evt.detail==Alert.YES){

??????????????????? this.shell.close();

??????????????? }

??????? ?? }

?

FlashShell类的更多属性请参考API

热点排行