-
[F8]How to add text scroller in textfield.
Hi,
I have made a dynamic web page that takes its text from external xml file. Its working perfect but I cant add scroller in the text field that scrolls the text when it is more than the text field. Anybody plz tell me how can I add scroller in the text field.
Best Regards,
-
FK'n_dog
example code (text hardcoded here, for external text use a LoadVars or XML object onLoad function)
PHP Code:
// on stage
// dynamic textfield - instance name - textF
// UIScrollbar - instance name - myScroller - drag onto textfield
// Button - instance name - btn
function test1(){
textF.text = "";
for(var n=0;n!=100;n++) textF.text += "test1 "+n+newline;
scrollIt();
};
function test2(){
textF.text = "";
textF.text = "test2"+newline+"test2";
scrollIt();
};
scrollIt = function(){
textF.maxscroll > 1 ?
myScroller._visible = true :
myScroller._visible = false;
};
test1();
// after text is assigned to a textfield you can check the
// textfields maxscroll property. if it's greater than 1,
// your textfield needs to scroll to display all its contents.
// test with a button instance - btn
btn.onRelease = function(){
bool = (pressed=!pressed) ? test2() : test1();
}
-
Thank you so much bro, you are always so helpful
I am gonna try it now.
Regards,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|