I'm sorry, but this change is not going to get in to the 1.0 release. At this point we're pretty much only taking fixes for bugs that crash the Player.
It can be worked around. Pasted below (thought I could attach but had to paste) is an example - it's really ugly - but it works. Getting ahold of the backgroundManager was tricky.
Its guaranteed this won't work in future releases - but hopefully the bug will be fixed in those.
Richard
// ActionScript file
package
{
import flash.display.DisplayObject;
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flashx.textLayout.compose.ISWFContext;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.factory.StringTextLineFactory;
import flashx.textLayout.factory.TextLineFactoryBase;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.tlf_internal;
use namespace tlf_internal;
public class StringFactoryExample extends Sprite implements ISWFContext
{
private var stringFactory:StringTextLineFactory;
private var factoryTextFlow:TextFlow;
private var target:Sprite;
static private var tempController:ContainerController = new ContainerController(null);
public function StringFactoryExample()
{
target = new Sprite();
addChild(target);
stringFactory = new StringTextLineFactory();
var format:TextLayoutFormat = new TextLayoutFormat();
format.backgroundColor="0xffff00";
format.fontSize = 24;
stringFactory.compositionBounds = new Rectangle(25,25,100,100);
stringFactory.spanFormat = format;
stringFactory.text = "Hello";
// hook in to catch the actual factoryTextFlow
stringFactory.swfContext = this;
factoryTextFlow = null;
stringFactory.createTextLines(addTextLine);
}
public function callInContext(fn:Function, thisArg:Object, argArray:Array, returns:Boolean=true):*
{
// save it off for later
if (!factoryTextFlow)
factoryTextFlow = TextLineFactoryBase._factoryComposer.textFlow;
if (returns)
return fn.apply(thisArg, argArray);
fn.apply(thisArg, argArray);
}
private function addTextLine(tl:DisplayObject):void
{
if (factoryTextFlow)
{
if (factoryTextFlow.backgroundManager)
{
var shape:Shape = new Shape();
tempController.setCompositionSize(stringFactory.compositionBounds.width,stringFactory.compositionBounds.height);
factoryTextFlow.backgroundManager.drawAllRects(shape,tempController);
//shape.x = stringFactory.compositionBounds.x;
//shape.y = stringFactory.compositionBounds.y;
target.addChild(shape);
}
factoryTextFlow = null;
}
target.addChild(tl);
}
}
}