Saturday, May 5, 2007

flash.text.TextRun

Generally, you don't instantiate this class yourself. Instead you retrieve and Array of TextRun objects by calling flash.text.TextField.getTextRuns(beginIndex:int, endIndex:int). A text run simply represents a continuous segment of text which has a single text format. So the string "123456789" would have 4 TextRuns: "12", "34", "56", "789".

The estimated source of the TextRun class is:
public dynamic class TextRun extends Object {
   public beginIndex:int;
   public endIndex:int;
   public textFormat:flash.text.TextFormat;
}


For more information see flash.text.TextField.getTextRuns().

1 comment:

Erik said...

According to describeType it is implemented like this:

package flash.test
{
 import flash.text.TextFormat;

 [ExcludeClass]
 class TextRun extends Object
 {

  public var textFormat:TextFormat;
  public var beginIndex:int;
  public var endIndex:int;

  public function TextRun(beginIndex:int, endIndex:int, textFormat:TextFormat)
  {
   this.beginIndex = beginIndex;
   this.endIndex = endIndex;
   this.textFormat = textFormat;
  };
 };
};


Greetz Erik

"Flex", "ActionScript" and possibly "MXML" are probably trademarks of Adobe Systems Incorporated.
"Adobe" is a trademark of Adobe Systems Incorporated.
This site is in no way endorsed or sponsored by Adobe Systems Incorporated.
Content Copyright © 2007 Daniel Freiman.
Site Design Copyright by its copyright holder.
The Flex Non-Docs reserves the right to remove comments for any reason.
All ActionScript and MXML code (and ONLY ActionScript and MXML code) on this website is available under the MIT License.