将事件添加到 Flex 4 Air 中的加载器中
我想知道是否可以在我的air应用程序的加载上添加一些作业,我的意思是: 我有一个事件处理程序,它获取事件“FlexEvent.APPLICATION_COMPLETE”,但该事件是在进度条结束后调度的,我想知道是否有一些事件我可以处理并在那里添加我的作业?!?
或者做到这一点的唯一方法是执行自定义预加载器??,如下链接:
谢谢大家!
I would like to know if it's possible to add some jobs on the onload of my air app, what I mean is:
I have an eventHandler which get the event "FlexEvent.APPLICATION_COMPLETE" but this event it`s dispatched after the progress bar ends, I would like to know if there is some event that I can handler and add my jobs there?!?
Or the only way to do this, it's doing a custom preloader??, like the link bellow:
Thanks for all!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应用程序在其创建和初始显示期间会分派四个事件:
preinitialize
initialize
creationComplete
applicationComplete
更多信息,请访问Adobe:关于启动顺序
编辑:
但是,直到所有 RSL 加载之后,即当预加载器触发 Event.COMPLETE(对于预加载的该部分)时,应用程序本身才会被实例化。当预加载器仍然显示时,应用程序上的
preinitialize
事件应该被触发,但初始化阶段相对于其他加载阶段可能要快得多。所以,是的,如果您想在预加载器加载 RSL 的同时执行某些操作,则必须编写自定义预加载器。There are four events that an Application dispatches during its creation and initial display:
preinitialize
initialize
creationComplete
applicationComplete
More info at Adobe: About Startup Order
EDIT:
However, the Application itself is not instantiated until after all the RSL's have loaded, ie., when the Preloader fires an Event.COMPLETE (for that part of the preload). The
preinitialize
event on the Application should get fired while the Preloader is still displayed, but the initialization phase might just be much faster relative to the other loading phases. So, yes, if you want to do something concurrent to the Preloader loading RSL's, you have to write a custom preloader.