Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

hide scroller

New Here ,
Jul 17, 2009 Jul 17, 2009

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;

}

TOPICS
ActionScript
793
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 17, 2009 Jul 17, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2009 Jul 18, 2009

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;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2009 Jul 18, 2009

place that code in a function and call that function after text is assigned.  any problems?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2009 Jul 18, 2009

hmm severals hours to get this right ><

possible to provide me a sample script for this please?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2009 Jul 18, 2009

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;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2009 Jul 18, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2009 Jul 18, 2009
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines