Diego, ExpandItem starts a tween that changes the position of the various items to show the new items over some period of time. Changing verticalScrollPosition before the tween finishes is not recommended.
There is an OPEN event when the tween finishes that would be a better time to make adjustments to what is seen, or you can try setting animiate=false as a parameter to ExpandItem. -Alex -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Diego Guebel Sent: Wednesday, January 17, 2007 12:22 PM To: [email protected] Subject: Re: [flexcomponents] updating scrollbar on a tree component what I did so far was: I extended the extendItem method in my custom tree adding the following: if(open) { var allChildren:int = getAllChildrenCount(item); // with this function I get the amount of new child recently added if((rowInfo[selectedIndex].y + super.rowHeight + (allChildren * super.rowHeight)) > listContent.height) { trace("need to scroll") verticalScrollPosition += 22; // Hardcoded number just for testing purpose } } it scrolls, but it also change the visibility of other items... Any clue? thanks, Diego. On Thu, 18 Jan 2007 07:11:54 +1300, Alex Harui <[EMAIL PROTECTED]> wrote: > You should be able to set verticalScrollPosition on the tree. It will > fix up the scrollbars for you. > > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Diego Guebel > Sent: Tuesday, January 16, 2007 8:46 PM > To: [email protected] > Subject: [flexcomponents] updating scrollbar on a tree component > > Hi there, > I just developed a tree that has the ability to add children on demand. > It > works just fine. > I want to be able to automatically pushed the rows up so that newly > expanded rows are available without user scrolling. > I've tried using different methods from the scrollbar classes with no > luck. Although I could scroll the rows it craches the tree. > > Any clue? > > Thanks in advance, Diego. > > > Yahoo! Groups Links > > > Yahoo! Groups Links
