Hi there,
I’ve nearly finished my site but I’m left with this little niggling problem. I want the scrollbar to appear only when it’s required but can’t for the life of me get it to do that.
Any help would be muchly appreciated.
Cheers
Dan
Hi there,
I’ve nearly finished my site but I’m left with this little niggling problem. I want the scrollbar to appear only when it’s required but can’t for the life of me get it to do that.
Any help would be muchly appreciated.
Cheers
Dan
You could make the scrollbar it’s own movie clip and attach it from the library. You can use maxScroll to determine how many lines are in your textbox.
So say your Dynamic Text box is only 10 lines tall and the text you’re putting in is more than that, you could say something like:
if (myText.maxScroll > 10) {
attachMovie(“Scrollbar”, “scrollbar”, 1);
scrollbar._x = 10
scrollbar._y = 10
}
This is assuming the Movie clip name of your scrollbar in the Library is Scrollbar and you want it at the position of 10, 10.
I’ve never used this code before, but I think it should work. Let me know if it doesn’t.
Actually, after further reading, maxscroll indicates how many lines you must scroll to reach the end of the text box, not how many lines are in it total. So I would think you could put:
if (yourtextfield.maxscroll > 0) {
attachMovie(“Scrollbar”, “scrollbar”, 1);
}
Hey, thanks for getting back to me. I still can’t get it to work, excuse me for being stupid but what do i attach the action to - I can’t attach it to the text box - do I just put it on a separate layer?
Cheers
Attaching it basically just means placing it on the stage. It will be on a _level, and not on a layer. I’ve been messing around with this this morning and can’t get it to work with the scrollBar component. Is that what you’re using? Another way I thought of is you could do this:
_root.onEnterFrame = function() {
if (yourtextfield.maxscroll > 1) {
myScrollBar._alpha = 100;
} else {
myScrollBar._alpha = 0;
}
}
Try something similar to that. It will probably need a little tweeking depending on how you’re using it, but I was able to get it to work.
thanks for you help on this, again, much appreciated.
I am indeed using the scrollBar component, I try the alpha route and see if i can get that working…
will let you know if i’m successfull,
have a good weekend
dan
just like this…
Hey, you’re an absolute *
I don’t really understand how it works but thanks nevertheless.
:: Copyright KIRUPA 2024 //--