Hello:
you can try this code:
-
var num:Number = 23.5674;
-
var mynum:String = (Math.round(num*100)/100).toString();
-
trace(mynum);
-
var mynum:String = (Math.round(num*1000)/1000).toString();
-
trace(mynum);
-
var mynum:String = (Math.round(num*10000)/100000).toString();
-
trace(mynum);
-
Hope this help you.
Mmm.. I think he's talkin about scrolling a dynamic textbox directly with the scroll property, if that's the case, there's no way to increment/decrement scroll with a float number.
Taruna, You should use a movieclip that holds the text and dynamically get the dymensions of that movieclip (cause the text is loaded externally, you said) and then calculate the proportion of movement between the scrollbar and the movieclip, and so on... the code it's rather long. I think in kirupa.com there are great tutorials to achieve this. I have my own version,that I think it's a little more useful but never made a tutorial out of it. Anyway, the "Simple Custom Scrollbar" it's a great tutorial on this subject, check it out.