mobileTofu
mobileTofu

Reputation: 1091

Managing multiple Windows in an AIR/Flex 4 app?

I have an AIR/Flex app that can have multiple windows (s:Window instances) open at a time. The app also allows the user to "dock" the main window; when docked, all the windows including the main application window become invisible and when undocked, all the aforementioned windows become visible. Also some windows are "singleton" only (no more than one instance opens at a time.) Now I am writing the code to manage all these (e.g., keeping track of which window(s) is opened and which window wants to be singleton, etc.) and wondering if there is an easier way to do this...

I looked at mx.managers.SystemManager and mx.managers.WindowedSystemManager, etc.. But by reading the documentation, it's still not quite clear if (at all) these are the classes that can help. Besides these two classes are inside mx namespaces but not spark classes, if it matters at all.

Upvotes: 0

Views: 1045

Answers (1)

Florian F
Florian F

Reputation: 8875

I think it will be easier your own window manager with methods such as , addWindow, removeWindow, showAllWindows, hideAllWindows, ...

Most of the time, you should avoid using the Singleton pattern. This manager should be responsible of instanciating windows and verify there is only one instance for some of them.

Upvotes: 1

Related Questions