8 Replies Latest reply on Feb 9, 2009 11:42 AM by Newsgroup_User

    UIComponent in the viewable area

    tagyro Level 1
      I'm building a xml-driven photo gallery and I want to implement some kind of preload.
      I want to know when an uicomponent (image/canvas/etc) is in the viewable of another uicomponent so I can preload the required info for the first one.

      breakdown:
      1. I read the xml file
      2. pre-load all of the thumbnails
      3. preload the other info (description, title, rating) for the viewable uicomponents that are on the stage and ignore the ones that are not.
        • 1. Re: UIComponent in the viewable area
          Level 7

          "tagyro" <webforumsuser@macromedia.com> wrote in message
          news:gmp985$cre$1@forums.macromedia.com...
          > I'm building a xml-driven photo gallery and I want to implement some kind
          > of
          > preload.
          > I want to know when an uicomponent (image/canvas/etc) is in the viewable
          > of
          > another uicomponent so I can preload the required info for the first one.
          >
          > breakdown:
          > 1. I read the xml file
          > 2. pre-load all of the thumbnails
          > 3. preload the other info (description, title, rating) for the
          > viewable
          > uicomponents that are on the stage and ignore the ones that are not.

          Use a List-based component, which will mainly just load data for the
          components that are visible within it.


          • 2. Re: UIComponent in the viewable area
            Cesare Rocchi Level 2
            what do you mean by "viewable"?
            If you plan to develop an horizontally scrolling gallery you can keep track
            of the x position of the scrolling canvas and run (pre)load actions according to that position.

            HTH.
            • 3. Re: UIComponent in the viewable area
              tagyro Level 1
              I load some Image components within a Canvas with horizontalScrollPolicy set to false and masking the Canvas so the horizontalScrollPosition is no use.

              By viewable I mean if the Image is under the mask.
              • 4. Re: UIComponent in the viewable area
                tagyro Level 1
                Thanks for the quick reply ...but I can't use the List component, for various styling reasons.
                And more, the problem is not loading the thumbnails - I preload all of the them at start - the problem is the "more info" I plan on loading for those thumbnails.
                • 5. Re: UIComponent in the viewable area
                  Level 7

                  "tagyro" <webforumsuser@macromedia.com> wrote in message
                  news:gmpbbq$fd1$1@forums.macromedia.com...
                  > Thanks for the quick reply ...but I can't use the List component, for
                  > various
                  > styling reasons.
                  > And more, the problem is not loading the thumbnails - I preload all of the
                  > them at start - the problem is the "more info" I plan on loading for those
                  > thumbnails.
                  >

                  The loading of the images is what is time-consuming, so I'm puzzled as to
                  why you're deferring the quick part...?


                  • 6. Re: UIComponent in the viewable area
                    Level 7

                    "tagyro" <webforumsuser@macromedia.com> wrote in message
                    news:gmpb14$eu6$1@forums.macromedia.com...
                    >I load some Image components within a Canvas with horizontalScrollPolicy
                    >set to
                    > false and masking the Canvas so the horizontalScrollPosition is no use.
                    >
                    > By viewable I mean if the Image is under the mask.

                    Look at childNum vs. horizontalScrollPosition. You'll need to calculate how
                    many images can show.


                    • 7. Re: UIComponent in the viewable area
                      tagyro Level 1
                      The images are only thumbnails so the loading is not so time consuming
                      I don't have the horizontalScrollPosition because the canvas that contains the thumbnails auto-sizes to fit all the images and is masked.
                      For each thumbnail I have to call 3 external js that return the rating, the description and the related items.
                      Unfortunately I can't change the process because the html is controlled by another department.

                      I wanted to know if there's some property (public or private) that tells me if the uicomponent is "visible" by the user.
                      I'll try with hitTestObject ...
                      • 8. Re: UIComponent in the viewable area
                        Level 7

                        "tagyro" <webforumsuser@macromedia.com> wrote in message
                        news:gmpgg8$led$1@forums.macromedia.com...
                        > The images are only thumbnails so the loading is not so time consuming
                        > I don't have the horizontalScrollPosition because the canvas that contains
                        > the
                        > thumbnails auto-sizes to fit all the images and is masked.
                        > For each thumbnail I have to call 3 external js that return the rating,
                        > the
                        > description and the related items.
                        > Unfortunately I can't change the process because the html is controlled by
                        > another department.
                        >
                        > I wanted to know if there's some property (public or private) that tells
                        > me if
                        > the uicomponent is "visible" by the user.
                        > I'll try with hitTestObject ...

                        If the Canvas autosizes to fit all the images, then you can probably assume
                        that all of the images are visible.