Copy link to clipboard
Copied
i seems to made a little bug in here.
the code actually working, till i adding for the scroller to hide when nothing is to scroll...
think i used the wrong statement or wrong formula, or more ><
can some1 help me out
tnx
-----------
welkom_text.addEventListener(Event.SCROLL,updateScroller);
function updateScroller(event:Event):void {
scrolling = true;
scroller.y =minScroll +(welkom_text.scrollV*scrollInterval/welkom_text.maxScrollV);
if (welkom_text.scrollV == welkom_text.maxScrollV) {
scroller.y = maxScroll;
} else if (welkom_text.scrollV == 1) {
scroller.y = minScroll;
} else if (welkom_text.maxScroll>0) {
scroller.visible=false;
}
Copy link to clipboard
Copied
1. you should be deciding whether to display the scroller or not during a scroll event. you should do that when text is assigned and/or a textinput event occurs.
2. you should display a vertical scroller if, and only if, the maxScrollV property is greater than 1.
Copy link to clipboard
Copied
ok i am still stuck...
I created a new actionlayer just for the scroller, to hide the scroller if the welkom_text is nothing to scroll. and if the welkom_text is something to scroll it will just display it...
but i am noob and the code below doesnt work
------
if (welkom_text.maxScrollV < 1) {
scroller.visible = false; }
else if (welkom_text.maxScrollV > 1) {
scroller.visible = true;
}
Copy link to clipboard
Copied
place that code in a function and call that function after text is assigned. any problems?
Copy link to clipboard
Copied
hmm severals hours to get this right ><
possible to provide me a sample script for this please?
Copy link to clipboard
Copied
call assignScrollerF() after text is assigned to your textfield:
function assignScrollerF(){
if (welkom_text.maxScrollV < 1) {
scroller.visible = false; }
else if (welkom_text.maxScrollV > 1) {
scroller.visible = true;
}
Copy link to clipboard
Copied
Thanks! I finally got it working now.
Hate debugging
its seems since i made my custom scroll bar - i had to set the value instead of zero to 15 (my scroller height) : P
and put the function in the external loader text
now all works smoothly
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now