How to allocate dyn. text to several textfields?

Hi all,

I was wondering how i can prevent a scrollbar, so i was thinking about allocating the text to several dyn. textfield (depending on the size of the text)

Any tips advice??

ok now i got this, not flexible yet and i got to split the text


 function displayDynText(pText:String, pTextFieldName:TextField, pTextFieldH:Number) {
	var pTextFieldName:TextField = createTextField(pTextFieldName, this.getNextHighestDepth(), 0,0, 340, pTextFieldH);
	pTextFieldName.multiline = true;
	pTextFieldName.wordWrap = true;
	//pTextFieldName.autoSize = "left";
	pTextFieldName.text = pText;
	if(pTextFieldName.textHeight > pTextFieldH) {
		var pTextFieldName1:TextField = createTextField(pTextFieldName, this.getNextHighestDepth(), 0,0+pTextFieldH, 340, pTextFieldH);
		pTextFieldName1.multiline = true;
		pTextFieldName1.wordWrap = true;
		//pTextFieldName.autoSize = "left";
		pTextFieldName1.text = pText;
	}
 }
 
 pText = "It has been a couple of years since I wrote about converting a disc hub to fixed gear, and the following might be considered a sequel to my original article.One of the problems in converting a gearie to a fix is that you won't easily find a big cog to match the outer chainring. This leads fixers to opt for a singlespeed-style 36:18 or similar setup, which means buying an expensive new cog and chainring. What a waste! They'd get more wear and less chainlaunch with a 44:22 setup based on their existing big ring.A year or two ago I was looking at my vast collection of unused 22t granny rings when I suddenly realised: hey, these would make good fixed gear cogs! Immediately I thought of machining adaptor plates to allow me to bolt the rings with their different bolt patterns to a standard six-bolt disc hub. Knowing the way my mind works, I waited for the revision that would make it accessible to the average bike tinkerer. A couple of months later my backbrain sent me the postscript I wanted. The beauty of the idea lay in its use of symmetry.";

 displayDynText(pText, pageContent, 200);

tx glosrfc,

It almost works like i want it too. The problem i have is, i want to have it dynamicly. And i can’t see how the text is being divided in your script.

At the moment i am playing with this


var txtArray:Array; // to hold text if it's larger

function displayDynText(pText:String, pTextFieldName_txt:TextField, pTextFieldH:Number) {
	var pTextFieldName_txt:TextField = createTextField(pTextFieldName_txt, this.getNextHighestDepth(), 0, 0, 340, pTextFieldH);
	pTextFieldName_txt.multiline = true;
	pTextFieldName_txt.wordWrap = true;
	pTextFieldName_txt.text = pText;
	//if text is larger than textfield
	if (pTextFieldName_txt.maxscroll != 1) {
		//we need to create another textfield(s) dynamicly
//so 1 becomes var i
		var pTextFieldName_txt1:TextField = createTextField(pTextFieldName_txt, this.getNextHighestDepth(), 0, 50+pTextFieldH, 340, pTextFieldH);
		pTextFieldName_txt1.multiline = true;
		pTextFieldName_txt1.wordWrap = true;
		pTextFieldName_txt1.text = pTextFieldName_txt.text;
		trace(pTextFieldName_txt.bottomScroll);
		
		for (i=0; i<pTextFieldName_txt.bottomScroll; i++) {
			trace(i);
			pTextFieldName_txt1.text += "
";
		}
		pTextFieldName_txt1.scroll = pTextFieldName_txt.bottomScroll+1;
		//we need to dynamicly create a button per textfield
		//for (var i=1; i < ??? ; i++) { 
		var page1:MovieClip = this.attachMovie('pageNumbers', 'page1', this.getNextHighestDepth()); 
		page1.pageNr.text = 1;
		page1._x = pTextFieldName_txt._width - 50;
		page1._y = pTextFieldName_txt._height + 5;
		page1.onRelease = function() {
			//load the text
			trace("Page 1");
		};
	}
}

//usage
displayDynText(pText, pageContent, 200);

Can i store the seperated text in an array? Or how should i do it?