4 Replies Latest reply on Aug 7, 2009 3:33 PM by jherr22

    Components for Viewstack not recognized

    jherr22

      My mxml application file has a ViewStack, with

             mxml:pages="pages.*"  in the application tag

      Within the ViewStack I have 5 views, each with a lot of stuff.

      So, I created 5 mxml components, one per view.

      Each view starts with a parent of VBox or HBox, and then has VBox and/or HBox children.

       

      Then I try to enter/reference the first one, within the ViewStack, as:

           <pages.Page1  id="Page1" >

      etc.

      Flex does not recognize the file 'Page1.mxml' in directory 'pages'

       

      If I enter the same thing just above the the ViewStack tag, it IS recognized.

       

      Conclusion, we can't use components for the views.

      I'm sure this is wrong.   What is wrong??

      Thanks

      --- john

        • 1. Re: Components for Viewstack not recognized
          Gregory Lafrance Level 6

          NOT:    mxml:pages="pages.*"  in the application tag

           

          BUT      xmlns:pages="pages.*"

           

          <pages:Page1  id="Page1" >      COLON, NOT DOT BETWEEN pages AND Page1

           

          If this post answered your question or helped, please mark it as such.

          • 2. Re: Components for Viewstack not recognized
            jherr22 Level 1

            I'm sorry, I typed both things wrong in the forum.

            I did them correctly in my actual file.

            So, my problem still exists.

             

            I really used:

            mxlns:pages="pages.*"

            and

            <pages:Page1 id="Page1"/>

             

            I tried something else:

            I surrounded the Page1 component with a 'Canvas'  tag.

            Then    <pages:Page1 id="Page1"/>    was recognized.

            So, do I have to surround every ViewStack component with a Canvas (or some other particular tags --- not including  VBox or HBox)??

             

            Is there a reference somewhere that goes into thorough explanations of how to use ViewStacks (and their relatives) -- everything I find in elementary.

            For example, getting deeper,  after the above worked,  then the AS3 functions, defined in the main file,  could no longer be seen from the component.

            There needs to be some article somewhere that goes into all this stuff.  Right???

             

            --- john

            • 3. Re: Components for Viewstack not recognized
              jherr22 Level 1

              Greg,

              Thanks for the response.

              The following is a copy of my reply to your response in the forum:

               

              I'm sorry, I typed both things wrong in the forum.

              I did them correctly in my actual file.

              So, my problem still exists.

               

              I really used:

              mxlns:pages="pages.*"

              and

              <pages:Page1 id="Page1"/>

               

              I tried something else:

              I surrounded the Page1 component with a 'Canvas'  tag.

              Then    <pages:Page1 id="Page1"/>    was recognized.

              So, do I have to surround every ViewStack component with a Canvas (or some

              other particular tags --- not including  VBox or HBox)??

               

              Is there a reference somewhere that goes into thorough explanations of how

              to use ViewStacks (and their relatives) -- everything I find in elementary.

               

              For example, getting deeper,  after the above worked,  then the AS3

              functions, defined in the main file,  could no longer be seen from the

              component.

               

              There needs to be some article somewhere that goes into all this stuff.

              Right???

              Thanks

              s--- john

              • 4. Re: Components for Viewstack not recognized
                Gregory Lafrance Level 6

                The views in a ViewStack must be containers, Canvas, HBox, VBox, etc. This is a great page on ViewStacks:

                 

                http://livedocs.adobe.com/flex/3/html/help.html?content=navigators_3.html

                 

                http://livedocs.adobe.com/flex/3/langref/mx/containers/ViewStack.html

                 

                If this post answered your question or helped, please mark it as such.

                1 person found this helpful