PDA

View Full Version : adding scroll to vgroup


flexable
05-24-2011, 06:36 PM
i want to add scroller control to this vgoup bt as in flex 3 theres no property for scroll...wat should i do...
package Components
{//class used to create vbox for the specific category
import spark.components.BorderContainer;
import spark.components.HScrollBar;
import spark.components.Scroller;
import spark.components.VGroup;
import spark.components.VScrollBar;

public class Item extends VGroup
{
public function Item()
{
super();

height=610;
width=550;
x=230;
y=0;



}

}
}

after this i call the object..
var vbbi:Item= new Item;
pn.addElement(vbbi)

but the scroll is not working..

Barna Biro
05-24-2011, 10:40 PM
The scrollbars should appear as soon as the content within your Item exceeds the height specified by you. If you want a scrollbar to be always present, then you might want to consider creating a Scrollbar instance and targeting your VGroup with it ( I don't recall the VGroup having any built-in functionality that would help you toggle any scrollbars on it... but you might want to read up on the Adobe LiveDocs and/or Language Reference on Group / VGroup )

flexable
05-25-2011, 07:28 AM
that is wat i cant find..how to target it...

dr_zeus
05-25-2011, 06:47 PM
Groups don't have built in scrollbars. Wrap it in a Scroller to make it work. Something like this:

<s:Scroller>
<ns:Item width="100%" height="100%"/>
</s:Scroller>

Or, in your Item class, have a child Scroller and a child Group where the content should go.