如何在actionscript / flex中创建“全局事件”?

时间:2021-08-29 23:53:43

What is the best way to create a 'global event' in flex/actionscript - preferably using a static class?

在flex / actionscript中创建“全局事件”的最佳方法是什么 - 最好使用静态类?

I want to raise an event to indicate that a stylesheet is loaded in order to show components that require that stylesheet. So I want each portion of the application that requires a style from the stylesheet to listen to an event telling it that the styles are all loaded.

我想引发一个事件来指示加载样式表以显示需要该样式表的组件。因此,我希望应用程序的每个部分都需要样式表中的样式来监听事件,告诉它样式已全部加载。

2 个解决方案

#1


1  

Use robotlegs, simple and Singleton free!

使用robotlegs,简单和单身免费!

#2


1  

Make a Singleton and add listeners to it, nice and simple.

创建一个单例并为其添加监听器,既简单又简单。

#1


1  

Use robotlegs, simple and Singleton free!

使用robotlegs,简单和单身免费!

#2


1  

Make a Singleton and add listeners to it, nice and simple.

创建一个单例并为其添加监听器,既简单又简单。