View Full Version : Text Area Component - Scroll Reset?
AdeelKhan
08-24-2005, 08:29 AM
Hi ,
i am using text area component and updating its text value __
_root.KPI_des = _root.comboKPI2.selectedItem.label; -- >
wordWrap= true;
The Problem
if i have scroll down the the text scroller and then updated my list box value which is updateing text component ( _root.KPI_des ) value . the scroll does rest . mean it does not go to top and stuck in middle or perivous scrolling position . :mad:
how can we reset scorolling position ??
please help out . :)
plz udpate me at adeel_hayat@hotmail.com or adeelfriends2003@yahoo.com
thanks in advance
cheers
newAS
08-24-2005, 12:08 PM
If this is what I thin it is I had the same problem. I had a movie which declared the FScrollBar in an actions layer. Then on another layer each frame loaded diferent content using the same dynamic text box and scrollbar.
Everytime I scrolled partially or all the way down and moved to the next fram the scrollbar would stay where it was before and consequently the text would not start at the top. This code sorts that right out:
myText.htmlText = myData.myText;
ScrollBar.setScrollPosition(0);
ScrollBar.setScrollTarget(myText);
ScrollBar._visible = (myText.textHeight > myText._height);
This also hides the Scrollbar if the content does not exceed the height of the dyanmic text box.
I hope this help you.
newAS
AdeelKhan
08-24-2005, 12:17 PM
thanks buddy for giving attention to my post .
well i solve that issue with my own way :)
------------------------------------
KPI_des_main.vScrollPolicy = "off";
KPI_des_main.text = KPI_des;
KPI_des_main.vScrollPolicy = "on";
---------------------------------------
this trick work for me :)
well i have another issue if u can plz help me out ..
i dont want to KPI_des_main.text to be selectable so wht i did
on(load){
_root.KPI_des_main.scroll.highlight = false;
_root.KPI_des_main.label.selectable = false;
_root.KPI_des_main.data.selectable = false;
_root.KPI_des_main.selectable = false;
}
it work fine when i first time run the applicatioin text is not selectable but when i update the textArea value and then try to scroll down it automatically select some text area and get stuck with scroll arrows :(
is it bug with flash text area component or i am missing something ?
is there any other alternative for mx textArea component which do samething for me ..
i really appriciate your help .
cheers
AdeelKhan
08-24-2005, 12:22 PM
if someone expert help me out ..
i dont want to TextArea ( KPI_des_main.text) to be selectable so wht i did
on(load){
_root.KPI_des_main.scroll.highlight = false;
_root.KPI_des_main.label.selectable = false;
_root.KPI_des_main.data.selectable = false;
_root.KPI_des_main.selectable = false;
}
it work fine when i first time run the applicatioin text is not selectable even when i scroll but when i update the textArea value and then try to scroll down it automatically select some text area and get stuck with scroll arrows
is it bug with flash text area component or i am missing something ?
is there any other alternative for mx textArea component which do samething for me ..
i really appriciate your help .
cheers
jaspers_cool
09-26-2005, 04:21 PM
Im not sure this is what you mean but you can scroll to the begining by setting the vPosition and reset the selection by setting it to 0, 0
//output is the instance name for the textarea
output.vPosition = 0;
Selection.setFocus("output");
Selection.setSelection(0, 0);
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.