1 person found this helpful
Your questions about new Spark components are quite common.
First of all let's clarify why the content inside your VGroup component (or other spark container) is not respecting the container's boundaries.
Take a look at VGroup base class called BaseGroup. Now realize that this class implements the interface IViewport.
If you take a look inside this class, you are gonna see that the interface defines an accessor method called clipAndEnableScrolling().
Now go back to BaseGroup class, the class that implements the interface IViewport, and realize that the default value of clipAndEnableScrolling property is false. So that if you want to clip the children to the bounderies of the VGroup container (the viewport), just set true to the property value.
Now let's talk about Scroller: You don't need to skin spark containers any time you want to use the Scroller component.
Please if you have a chance, take a look at the source of this class in Flex 4 framework: spark.components.Scroller
If you pay attention to this code you will realize it has a property called viewport. The scroller component displays a viewport and also horizontal and vertical scroll bars. The only requirement is that the viewport must implements the IViewport interface. As we could see above, looks like VGroup implements it.
So that you can have a code like this:
<s:TextArea width="200" height="300"/>
Just a tip: Using the Scroller component there is not need to set clipAndEnableScrolling to true once it's is done automatically.
Hope you could understand my English ...
crap I gave you only helpful, not answered my question feedback!
Perfect answer thank you very much! I knew the scroller class worked for skinning, never thought to use it on any component I wanted to scroll for some reason...
Thank you very much!
The new spark components are quite different from Halo ones but they are introducing a real separation between business logic and visual appearence. Let's enjoy it.
Nice to help you!