You would think so... however, i have found that you have to set the 
height of a vBox to a pixel height, not percentage to get the 
scrollbars to act the way you want them to.

By default a vBox's height will autosize to the combined height, plus 
verticalGap... of all it's children, UNLESS you set it's pixel 
height, which then properly display's scrollbars.

In this case, I would bind the height of the vBox to it's parent 
canvas height, that should do it.

This is very weird to me as well, and if you contrain the layout of 
the vbox to be top=0 and bottom=0, as if you are wanting to anchor or 
dock it so it resizes when the parent resizes, it won't work either.

The height must be set to a pixel height.  To get around this i had 
to tie into the resize even of my parent container and convert the 
size of my vbox appropriately... annoying, not what i expected i 
would have to do.


hope that helps some....

--Scott



--- In flexcoders@yahoogroups.com, Tom Bray <[EMAIL PROTECTED]> wrote:
>
> Shouldn't the height of the VBox below end up being 300?  
Shouldn't  
> height="100%" make it fill up the area allotted to it by it's  
> parent?  Instead it ends up having a height of 612 and no scrollbar:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";  
> layout="absolute" horizontalScrollPolicy="off"  
> verticalScrollPolicy="off">
>       <mx:Canvas width="500" height="300" 
horizontalScrollPolicy="off"  
> verticalScrollPolicy="off">
>               <mx:VBox id="badVBox" width="100%" height="100%">
>                       <mx:Canvas width="100%" height="200" 
backgroundColor="green"/>
>                       <mx:Canvas width="100%" height="200" 
backgroundColor="green"/>
>                       <mx:Canvas width="100%" height="200" 
backgroundColor="green"/>
>               </mx:VBox>
>       </mx:Canvas>
>       
>       <mx:Button y="400" label="debug" click="debug()"/>
>       
>       <mx:Script>
>               <![CDATA[
>                       public function debug():void
>                       {
>                               var v:VBox = badVBox;
>                       }
>               ]]>
>       </mx:Script>
> 
> </mx:Application>
>


Reply via email to