`
zhanghan
  • 浏览: 189848 次
  • 性别: Icon_minigender_1
  • 来自: 郑州
社区版块
存档分类
最新评论

flex window窗体内无法弹出alert的问题解决

    博客分类:
  • Flex
阅读更多
有感某论坛上的驴头不对马嘴的回答,我找了一下答案。部分是我的假想内容

首先,我也遇到了同样的问题。
我作的一个软件,先有登录界面,然后才是系统主界面。
登录界面用windowedapplication实现,主界面使用window来作的。
在window界面里面是死活也弹不出alert。
后来测试发现,并不是弹不出来,而是显示 不出来。
系统会显示在我们的windowedapplication这个窗口里在。
所以 我认为是系统默认的alert容器的问题。
改用以下方法是可以弹出来的
Alert.show(内容,标题,按钮,this或子窗口其它器件)

当然哪位有更好解决办法的话,可以告知我一声。呵呵。
分享到:
评论
4 楼 custjcy 2014-02-24  
又找到两篇相关的文章: http://forums.adobe.com/message/3079469
http://soenkerohde.com/2008/08/popupalert-parent-in-multi-window-air-application/
都有遇到我提的问题。这个应该是sdk的一个bug: https://issues.apache.org/jira/browse/FLEX-26047

这个问题在debug的时候会出现,但是release的时候就正常。
3 楼 custjcy 2014-02-24  
我也遇到了这个问题,但是修改以又遇到了异常:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::WindowedSystemManager@79760b1 to mx.managers.SystemManager.
     at mx.accessibility::AlertAccImpl/eventHandler()[E:\dev\4.x\frameworks\p rojects\framework\src\mx\accessibility\AlertAccImpl.as:187]
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\f ramework\src\mx\core\UIComponent.as:12528]
     at mx.core::UIComponent/set initialized()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UI Component.as:1627]
     at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\framewo rks\projects\framework\src\mx\managers\LayoutManager.as:759]
     at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x \frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]

我的flashbuild版本4.0, sdk是4.1。想要显示alert的容器也是一个mx:window
2 楼 javaEEdevelop 2011-04-08  
就是这个原因,讲得好啊
1 楼 cavenshen 2010-02-08  
Alert他默认弹出的容器为最WindowedApplication容器,因此你如果想要在window容器中显示出来Alert信息的话,需要在Alert的时候指定他的parent为this就可以了。

相关推荐

Global site tag (gtag.js) - Google Analytics