6 Replies Latest reply on Aug 9, 2007 11:16 AM by ntsiii

    ViewStack: number of children?

    Level 7
      Is there a physical or practical limit to the number of children a
      ViewStack can have?

      Mark
        • 1. Re: ViewStack: number of children?
          ntsiii Level 3
          None that I have ever heard of. Client memory is the only physical limit i can imagine.

          Tracy
          • 2. Re: ViewStack: number of children?
            Level 7
            ntsiii wrote:
            > None that I have ever heard of. Client memory is the only physical limit i can imagine.
            >
            > Tracy

            Tracy

            Thanks for the reply.

            Can you elaborate a little?

            If I am using Defered Creation for the ViewStack children so that they
            are only instantiated as they become active, is there still potential
            for problems with client memory? Or is this just going to help start-up
            time?

            Once instantiated, but no longer visible, are children still in memory?
            so if I have 100 children for example, and the user goes through them
            linearly from child 1 through 100, by the time no 100 is instantiated,
            does the client machine now have all 100 in memory? Can I remeove them
            from memory if so?

            Thanks for any help.

            Mark
            • 3. Re: ViewStack: number of children?
              ntsiii Level 3
              "Once instantiated, but no longer visible, are children still in memory? " Yes
              "Can I remeove them from memory if so". No

              If that is a realistic scenario, you should probably look into "modules" or using SWFLoader.

              Tracy
              • 4. Re: ViewStack: number of children?
                Level 7
                ntsiii wrote:
                > "Once instantiated, but no longer visible, are children still in memory? " Yes
                > "Can I remeove them from memory if so". No
                >
                > If that is a realistic scenario, you should probably look into "modules" or
                > using SWFLoader.
                >
                > Tracy
                >


                I thought it was possible to dynamically remove (or add) children? Would
                that not cause it to be removed from memory?

                I am not currently familiar with modules, so I will read up on that.

                I am looking at creating a paging structure to create eLearning in Flex,
                so 100 'pages' is possible. My initial idea was to use a ViewStack for
                this but I am not sure now if this is the best approach.

                Mark
                • 5. Re: ViewStack: number of children?
                  ntsiii Level 3
                  Yes, yo can dynamically add and remove childern and they will be garbace collected if you are very careful about removing all references, including event listeners.

                  It depends on how complex each page is. I would implement it using ViewStack, with each page an individual component. Keep the components loosely coupled from the parent, by using events and bindings for data communication. This way, If you find later that you have performance issues, you can keep the outer UI framework, most of the navigation code, and all of the component code, and only have to change how the components are rendererd.

                  Tracy
                  • 6. Re: ViewStack: number of children?
                    ntsiii Level 3
                    And actually, you might have only a single "Page" component, whose content is data-driven .

                    Are your page components going to be wildly different in interactivity? If not, then make them data-driven. This will eliminate your memory concerns entirely.

                    Tracy