View Full Version : tabIndex and scrollPains
11-03-2004, 04:05 PM
I have built a form which contains various components. the form is nested within the scrollpane. i would like the form to scroll as the user either tabs or gives focus to the components -so the user does not have to manally scroll? make sense?
i have attached the fla to better explain what i mean, does anybody know if it is possible or how to best implement something like this?
11-05-2004, 06:27 PM
First of all, you can get the x and y positions of the components (inside the scrollPane). So say you have 5 items, 2 are visible right now and 3 are below the viewable area of the scrollPane.
Item 1. X=0 Y=0 <--this one shows up right away
Item2 X=0 Y=50 <-- this one also shows up
Item3 X=0 Y=150 <--- Doesnt show
Item4 X=0 Y=200 again doesnt show
Item5 X=0 Y=250 doesnt show
So when you tab through your components your gonna need to know what item your on and its properties, then move the scrollPane down.
So try using the onGetFocus event (or whatever its called)
and do something like
_root.myScrollPane.setScrollPosition(pathtoControl ._x, pathtoControl._y);
This should move the scrollPane scrollers DOWN to where the x and y of whatever instance are located. You may need to play with it to make it show up centered (or not right at the top) and the event may need to be changed.
but that should work.
Now if anyone can tell ME how to get X&Y Pos of a textSnapshot object. THAT WOULD BE SOMETHING!
vBulletin® v3.8.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.