1 Reply Latest reply on Apr 9, 2009 11:38 AM by Gregory Lafrance

    Extending modules

    nishantkyal Level 1

      Hi,

       

      Here's the scenario:

      I am preparing product preview modules for my application. The core of the module has a viewstack and controls to navigate the stack. The modules extending this module need to have the viewstack replaced with different graphics so that controls in each of these modules is linked to the modified viewstack.

       

      Attaching code files.

       

      My problem is that the modified viewstack doesn't show up.

       

      Brief of the sample code:

      Base module viewstack

      <mx:ViewStack id="previewStack"/>

       

      Extended module viewstack

      <previewstack>

           <mx:ViewStack>

                <mx:Canvas>

                     <mx:Image source='{some embed}'/>

                <mx:Canvas/>

                 <mx:Canvas>

                     <mx:Image source='{some embed}'/>

                <mx:Canvas/>

                 <mx:Canvas>

                     <mx:Image source='{some embed}'/>

                <mx:Canvas/>

           </mx:ViewStack>

      </previewstack>

       

      The viewstack in extended module doesn't show anything but the assets sure got embedded as inferred from filesize

        • 1. Re: Extending modules
          Gregory Lafrance Level 6

          I wonder if the sub-ViewStack needs to be wrapped in a VBox or something. Try this:

           

          <?xml version="1.0"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:LinkBar dataProvider="{vs1}"/>
            <mx:ViewStack id="vs1">
              <mx:VBox label="BlackRed">
                <mx:LinkBar dataProvider="{innerVS1}"/>
                <mx:ViewStack id="innerVS1">
                  <mx:VBox label="Black">
                    <mx:Image source="@Embed(source='black100_100.JPG')"/>
                  </mx:VBox>
                  <mx:VBox label="Red">
                    <mx:Image source="@Embed(source='red100_100.JPG')"/>
                  </mx:VBox>
                </mx:ViewStack>
              </mx:VBox>
              <mx:VBox label="GreenGray">
                <mx:LinkBar dataProvider="{innerVS2}"/>
                <mx:ViewStack id="innerVS2">
                  <mx:VBox label="Green">
                    <mx:Image source="@Embed(source='green100_100.JPG')"/>
                  </mx:VBox>
                  <mx:VBox label="Gray">
                    <mx:Image source="@Embed(source='gray100_100.JPG')"/>
                  </mx:VBox>
                </mx:ViewStack>
              </mx:VBox>
            </mx:ViewStack>
          </mx:Application>