PDA

View Full Version : maxScrollV and bottomScrollV bug?


mammy
04-04-2008, 12:07 AM
hey all,
am i crazy or does flash 9 have a bug where maxScrollV and bottomScrollV reports ridiculously wrong line numbers?

i have a textField with wordWrap and mulitline turned on and autoSize off and the width/height set to have 18 lines viewable at my chosen font style/size.

when i put enough text to generate 18 lines i get a maxScrollv of 430 and a bottomScrollV of 6 with scrollV set to 1. this happens with either text or htmlText.

bug? if so, then i guess i have to fudge the values to know when text falls below the fold.

TIA
michael

amarghosh
04-04-2008, 05:19 AM
i haven't had a problem with scrollV properties -- can u post some code?

mammy
04-04-2008, 03:56 PM
i haven't had a problem with scrollV properties -- can u post some code?

here it is:

tf = new TextFormat();
tf.font = "Verdana";
tf.size = 12;
tf.align = TextFormatAlign.LEFT;

var txt = new TextField();
txt.defaultTextFormat = tf;
txt.multiline = true; // this makes the html <br> tag work
txt.wordWrap = true;
txt.text = "1500 characters of text here all in one line w/o line breaks; // there is only one text field in this call
txt.autoSize = TextFieldAutoSize.NONE;
txt.width = 600;
txt.height = 316;
txt.x = 0;
txt.y = 0;

trace(txt.maxScrollV); // yields 777 which should be around 35
trace(txt.bottomScrollV); // yields 6 which should be 17 since there are 17 lines exposed in the field
trace(xt.numLines); // yields 783

mammy
04-04-2008, 05:50 PM
just realized that if i divide numLines by 21 i get an accurate line number regardless of the amount of text but only with .text. if i use .html i can't divide by any one number to get an accurate line count since numLines and maxScrollV don't seem to be able to account for html formatting. ie. if you use an ordered list in html text it throws the numLines off.

mammy
04-04-2008, 08:27 PM
solved it. stupid mistake. didn't have .htmlText as the last call in the txt field creation block. that fixed it.