Well again, this is for archive and maybe it’ll save someone some time
This is a screenshot of a test with the code below. It has 2 different TextArea components with differing fonts and font sizes that page the text perfectly between the 2 controls.

if you’ve ever tried to do paging or find out how many lines were being occupied in a TextArea’s TextField, this is one way to accomplish the task that seems to work every time. It’s pretty straight forward in that you just need to get to the TextField object that the TextArea uses. Simply test maxScrollV after calling validateNow on the TextArea and bam, you’re in business.
package
{
import flash.events.Event;
import flash.text.TextField;
import mx.controls.TextArea;
import mx.core.WindowedApplication;
import mx.core.mx_internal;
import mx.events.AIREvent;
//use namespace mx_internal;
public class BasicApplicationTestBase extends WindowedApplication
{
public var t0:TextArea;
public var t1:TextArea;
public var txt:String = “Well, it’s not secret that Papervision3D has taken the Flash world by storm, surprise and to the next era of Flash design and development. It’s become a regular word in the arsenal of any Flash designer and developer around the community and we’re really excited about being apart of that! One of the cool things about having an impact like this is the attention Adobe started to give the 3D API’s that were emerging.”;
public var words:Array = [];
public function BasicApplicationTestBase()
{
super();
addEventListener(AIREvent.WINDOW_COMPLETE, handleComplete, false, 0, true);
}
protected function handleComplete(e:Event):void
{
// split up the string at the spaces
words = txt.split(” “);
}
public function doIt(e:Event=null):void
{
// set the target textArea
var target:TextArea = t0;
// clear the current text
target.text = “”;
// set the target textArea’s textfield
var textField:TextField = t0.mx_internal::getTextField() as TextField;
for( var i:int=0; i 1 )
{
// set back to original before changing the target
target.text = originalText;
// set new target TextArea control
target = t1;
// set the word we’re on to the new target, or else we loose it
target.text = words[i] + ” “;
// set new TextField object
textField = t1.mx_internal::getTextField() as TextField;
}
}
}
}
}


October 2, 2008 at 8:14 am
How do I copy the code without line numbers ?
thanks
October 2, 2008 at 2:24 pm
There is a “plain text” button at the top of the code – doesn’t look like a button, but just click the text and you’ll see it switch to plain text for you to copy
October 3, 2008 at 1:58 am
awesome! thankyou!
I’m almost ashamed to admit it now but for a long time I have been doing much dodgey business with 3 text fields, different y positions + some masking to get column flow in flash.
November 24, 2008 at 1:03 am
[...] TextArea Paging A great trick for detecting the overflow of a TextArea for spilling into another TextArea. Perfect [...]
December 18, 2008 at 11:47 pm
Hi,
I’ve cut and paste the code from above, but it doesn’t compile. Can you send me the text version of this code. I don’t see the plain text button referred to in the previous reply.
Thanks,
David
February 19, 2009 at 3:32 am
[...] How to detect when a TextArea is full: Paging [...]