Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It sounds like what you need is to put all the modules into a <a href="http://livedocs.adobe.com/flex/3/langref/mx/containers/ViewStack.html" rel="nofollow noreferrer">ViewStack</a>. Then you have a choice:</p> <ul> <li>You can simply bind to an index in the combobox (or an index specified by the combobox data like I have in the example below).</li> <li>You can pickup the <a href="http://livedocs.adobe.com/flex/3/langref/mx/controls/ComboBox.html#event:change" rel="nofollow noreferrer">change event</a> of the ComboBox and manually change the <a href="http://livedocs.adobe.com/flex/3/langref/mx/containers/ViewStack.html#selectedChild" rel="nofollow noreferrer">selectedChild</a> of the ViewStack.</li> <li>You can </li> </ul> <p>Something like:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt; &lt;mx:Script&gt; &lt;![CDATA[ [Bindable] public var modules:Array = [ {label:"Module A", moduleIndex:0}, {label:"Module B", moduleIndex:1}, {label:"Mobule C", moduleIndex:2} ]); ]]&gt; &lt;/mx:Script&gt; &lt;mx:ComboBox dataProvider="{modules}" id="modulesCombobox" /&gt; &lt;mx:ViewStack id="modulesViewStack" creationPolicy="auto" selectedIndex="{modulesCombobox.selectedItem.moduleIndex}"&gt; &lt;mx:ModuleLoader id="moduleA" url="{'views/ModuleA.swf}" /&gt; &lt;mx:ModuleLoader id="moduleB" url="{'views/ModuleB.swf}" /&gt; &lt;mx:ModuleLoader id="moduleC" url="{'views/ModuleC.swf}" /&gt; &lt;/mx:ViewStack&gt; &lt;/mx:Application&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload