Checking the close event of browser in flex
来源:互联网 发布:支持网络打印 编辑:程序博客网 时间:2024/05/26 08:43
Modify the index.template.html file by adding in the following scripts:
1: <script language="JavaScript" type="text/javascript">
2: window.onbeforeunload = clean_up;
3:
4: function clean_up()
5: {
6: var flex = document.${application} || window.${application};
7: flex.myFlexFunction();
8: }
9: </script>
Then add following codes in the flex code file:
1: import flash.external.ExternalInterface;
2:
3: public function cleanUp():void
4: {
5: fromSwf.close();
6: }
Also add this statements in the initialize function of the flex page, which is usually bind with the initialize property of the Application:
1: ExternalInterface.addCallback("myFlexFunction",cleanUp);
- Checking the close event of browser in flex
- Trick:Checking the Contents of Descriptors in MSVC6(Symbian)
- Why is the window.close() works in IE browser but not FireFox? "Warning: Scripts may not close windo
- JavaScript in the browser
- Listening for the link event in a Flex Label control
- Breaking Out of the Browser
- The Security Architecture of the Chromium Browser
- Changing the layout direction of a form item in Flex
- Tamarin,the VM in the browser!
- Summary of the October 22,2012 AWS Service Event in the US-East Region
- how to know the type of browser
- History of the browser user-agent string
- 25 Secrets of the Browser Developer Tools
- 浏览器数据包截获Man-in-the-browser
- One of the Keyborad Event
- One of the Mouse Event
- the advantages of event delegation
- The onmousewheel event of JavaScript
- java学习方法
- 进入公司前与Boss的会谈话
- 在Struts中Action传参数 [转总结]
- 噪声污染
- 客户端delphi使用XML与中间层C#.net通信的例子,客户端用idhttp的post发送请求
- Checking the close event of browser in flex
- 拿来主义
- GetRuntimeClass(void)const error
- 【转帖】C#中窗体间传递数据的几种方法
- C++中rand随机数的用法
- VC++2005MFC -中文文本操作
- 俺就是没有情缘!
- HP-UX基本操作
- 如何通过在 SQL Server 的早期版本使用客户端工具连接到的 SQL Server 2005 或 SQL Server 2000 命名实例