2 Replies Latest reply on May 20, 2010 6:05 AM by jaywhy13

    "Out of view" viewstack does not invalidate children


      Hi all, I have a class I've made called a SlidingViewStack. It attaches itself to a canvas, turns the horizontal and vertical scroll policy off and sets clipContent to be true so that the view stack will be hidden when it is out of view. When the view stack is first initialized, the content is fine... however, when I change the selectedIndex of the view stack when it is not "in view" when I bring it back into view, all my labels are truncated.


      As you can see from the image above "M.." is really supposed to say "Map Settings" and "B..." is "Base Map"

      I have tried calling validateNow(), invalidateDisplayList(), invalidateProperties(), invalidateSize() on the VBox (container for the elements)... none work. I've tried invalidating the label on roll over and that makes the label repaint as quickly as I hover over it. Any advice on approach here? I'm left to think that the kids of the VBox are not being invalidated properly or something.

        • 1. Re: "Out of view" viewstack does not invalidate children
          BhaskerChari Level 4

          Have you set the resizeToContent="true" on ViewStack....If not try to set that propert and check once...


          If your problem is not solved try posting sample code reproducing the problem.


          If this post answers your question or helps, please kindly mark it as such.



          Bhasker Chari

          • 2. Re: "Out of view" viewstack does not invalidate children
            jaywhy13 Level 1

            That hasn't changed anything... I'll try as best as possible to explain it. It's a big class.

            It's called a ViewStackSlider... it has a "tray" that holds icons and an array of containers. So...

            public function addSlidingContent(icon:Image,container:Container):void {

            // Add the icon





            // Add container




            // Show the tray... this might not show anything... show icon tray does checks before showing

            showIconTray(); // pop open the icon tray


            Above, I add an icon and a container. I add some listeners to the icon so that when the icon is clicked, the view stack slides in. Basically, when the user clicks an icon.. activateContent(number) is called.. where number is an index into the array collection.
            * Activates an index, and slides up the view stack
            public function activateContent(index:Number):void {
            if(index >= containers.length) {
            Application.application.cwmTrace(name + ": cannot activate index: " + index);
            Application.application.cwmTrace(name + ": activating: " + index);
            var container:Container = containers.getItemAt(index) as Container;
            viewStack.selectedIndex = index;
            activeIndex = index;
            So I get the container, change the view stack selected index to that index, try and invalidate the container and then I call slideStackIn()
            public function slideStackIn():void {
            Application.application.cwmTrace(name + ": Sliding stack in");
            if(viewStackCanvas.parent == null) return;
            if(!effectParamsValid) updateEffectParameters();
            if(viewStackCanvasState == COMP_HIDDEN){
            } else {
            I actually have the viewstack in a canvas, viewStackCanvas and I move the canvas around... so the canvas contains the view stack and I animate the canvas. In effect slides the canvas from being "out of view" into view where the user can see it. The view stack canvas hides outside the boundaries of it's parent until the slideStackIn() method is called.
            Hope this is clear. Thanks for the help thus far.


            Reformatted the text so the code was distinguishable from text.