Hey all,
I asked a question about this earlier, but now I have a better idea of what’s going on and what I’m trying to do. So, my problem is this:
I have a single texfield. I want to set the default format of that textfield to a certain value and alignment. Then, draw the text onto a bitmapdata. Then, I want to change the default format of THAT single textfield to a new format, change the alignment, and change the text contained in it. Then draw it at a new location.
I want to do the above many times to use the same textfield to draw in multiple locations in multiple styles.
My would look something like this:
var bmd:BitmapData = new BitmapData(500,300);
var tField:TextField = new TextField();
tText.autoSize=TextFieldAutoSize.RIGHT;
tText.setTextFormat(style_large); // style_large is defined already
tText.htmlText="Hello World."
bmd.draw(tText,new Matrix(1,0,0,1,10,10));
tText.autoSize=TextFieldAutoSize.LEFT;
tText.setTextFormat(style_small); // style_small is defined already
tText.htmlText="This is me";
bmd.draw(tText,new Matrix(1,0,0,1,10,40));
tText.autoSize=TextFieldAutoSize.RIGHT;
tText.setTextFormat(style_large);
tText.htmlText="Oh my Gosh!";
bmd.draw(tText,new Matrix (1,0,0,1,10,80));
tText.setTextFormat(style_small);
tText.htmlText="Cruddy, duddy");
...
When I attempt to do something like that, tText will change formats once, but then will remain at the last format it was set to.
In addition, the only way I can seem to get this to function any where near correctly is by recreating tText.
So, is there any way to do this besides using multiple TextFields?