开发者

Flex Air, static main window reference?

开发者 https://www.devze.com 2023-01-07 04:57 出处:网络
As I can get a reference to the main window of an Air Flex application within a component? (The开发者_Python百科 component is not in the main MXML)Try FlexGlobals.topLevelApplication as WindowedApplic

As I can get a reference to the main window of an Air Flex application within a component? (The开发者_Python百科 component is not in the main MXML)


Try FlexGlobals.topLevelApplication as WindowedApplication for flex4. Should do 'er.


This should do it:

var topLevelApplication : Application = Application.application as WindowedApplication

Reference: http://livedocs.adobe.com/flex/3/langref/mx/core/Application.html#application


In Flex 4, you should use the topLevelApplication property of the FlexGlobals class, something like this:

var topLevelApplication : Application = FlexGlobals.topLevelApplication as WindowedApplication
0

精彩评论

暂无评论...
验证码 换一张
取 消