外界与Flex Application的交互处理(之嵌入html)
来源:互联网 发布:保定市信融网络限公司 编辑:程序博客网 时间:2024/05/16 01:41
Flex采用IFrame嵌入html,可参考http://www.deitte.com/archives/2006/08/finally_updated.htm,这是Brian Deitte写的一个IFrame Control对象,非常好用。但在实际应用中,还会有一些问题,需要在外围解决。
(1)使用IFrame可能碰到的问题:不能随着窗口的位移或调整自动调整。
我是在Popup的TitleWindow中,采用TabNavigator动态载入一些Tab,这些Tab页可能是Flex Container,也可能是IFrame Control(也就是嵌入的iframe中html页面)。因为是扩展出的TitleWindow,允许调整大小和位移,但在调整大小和位移过程中,会造成 IFrame 中的html页面不跟随移动。
这个问题就必须额外监控mouse事件,刷新IFrame的invalidateDisplayList。
- override protected function oMouseUp(event:MouseEvent):void{
- super.oMouseUp( event );
- //cacheIFrameTabPanels是索引的当前TabNavigator中所有IFrame对象
- for each(var panel:IFrame in cacheIFrameTabPanels){
- Container(panel).invalidateDisplayList();
- }
- }
(2)使用IFrame可能碰到的问题:Tab切换多次后,造成html页面悬浮,不切换。
这时候,必须额外监控tabnavigator的change事件,将IFrame设置visible为false,(实际上就隐藏iframe中的html页面)。
- protected function checkIFrameTabPaneVisible(event:IndexChangedEvent):void{
- var panel:DisplayObject = nav.getChildAt( nav.selectedIndex );
- for each(var panel1:IFrame in cacheIFrameTabPanels){
- Container(panel1).visible = false;
- }
- if(panel is IFrame){
- Container(panel).visible = true;
- }
- }
(3)使用IFrame可能碰到的问题:Popup的TitleWindow关闭后,html页面仍悬浮。
这个就简单多了,监听TitleWindow的close事件,将相应的IFrame visible设置为false即可。
(4)IFrame并没有对嵌入的iframe和html做回收,这个需要自己扩展。
IFrame中只是采用了visible来隐藏和显示iframe的内容。所以在实际应用中,需要对一些操作做回收,这个需要自己扩展。
- <mx:TabNavigator id="nav" dropShadowEnabled="true" width="98%" height="100%" horizontalGap="0" change="checkIFrameTabPaneVisible(event)"/>
- 外界与Flex Application的交互处理(之嵌入html)
- 外界与Flex Application的交互处理(之嵌入html)
- 外界与Flex Application的交互处理(之嵌入html)
- 外界与Flex Application的交互处理(之嵌入html)
- 外界与Flex Application的交互处理(之传递参数)
- 外界与Flex Application的交互处理(之传递参数)
- 外界与Flex Application的交互处理(之传递参数)
- .NET与外界交互字符串的处理
- PB与外界的交互方式
- PowerBuilder与外界的交互方式
- PowerBuilder与外界的交互方式
- flex 学习笔记之 Application与子component交互的两个方法
- flex 嵌入简单的html
- flex(as) 与 html(js)的通信交互
- HTML嵌入Flex,wmode的用法
- Flex嵌入完整的html网页
- flex与html页面的交互(1) - 访问环境信息
- java与flex交互时的乱码问题如何处理
- linux的shell中,日期格式校验
- 无需提交就可以改变页面内的链接地址
- Spring与struts 整合的三种方式
- DSP 汇编
- Cygwin
- 外界与Flex Application的交互处理(之嵌入html)
- 系统程序员成长计划写作提纲
- CUDA 矩阵转置
- 被放大的细节
- 应用开发平台成软件业撒手锏 市场凸显四大格局
- Command Pattern: We used but we didn't recognize (转)
- 解释器模式(interpret pattern)
- 今天开通了CSDN网站的空间
- ★黑客基地★ - 全球最大的黑客与安全技术门户