dynamically creating columns of text
So I've got a site where I'm loading information from XML. Sometimes the screen layout will have two or more columns of text. I'm trying to build an actionscript component that will flow the text into multiple columns.
The best approach I can think of is to load the same text into all columns, and then use the "scroll" property to make it appear that the text is flowing from one column to the next: here's my best attempt:
columns = 2;
lines = 9;
for (b=0; b<columns; b++) {
eval("column"+b) = content;
eval("column"+b+".scroll") += lines*b;
}
The text variables are named column0, column1 etc.
I can't figure out any way to dynamically calculate the number of lines in a column (which I need to determine the location of the text breaks). If anyone can think of a way I can do that dynamically, I'd love to know.
However, the big problem is that the last line
--eval("column"+b+".scroll") += lines*b --
doesn't work here. It'll work if I put it in a seperate button and treat it as an on-click action, but I need it to occur when I load the frame. Can anyone help me?
Or, if anyone knows of a better way to create columns, I'm open to suggestions!
#
|