Wow. Its been a long time since I asked a question here!
I'm trying to re-create a tweened banner with gradient filled (and broken apart ) text with dynamic text.
I'm using this code inside a loop: aTxt is an array of strings populated from an XML object
code:
var fmtText:TextFormat = new TextFormat();
fmtText.font = "TrajanPro";
fmtText.size = 30;
fmtText.color = 0xE3D280;
// ...
// get the width of the textfields
var txtMetrics:Object = fmtText.getTextExtent(aTxt[i]);
this["mv_"+i].createTextField("txt", 2, 0, 4, txtMetrics.textFieldWidth, txtMetrics.textFieldHeight);
this["mv_"+i].txt.text = aTxt[i].toUpperCase();
this["mv_"+i].txt.setTextFormat(fmtText);
I need to use the TextFormat method because thats the only way i can get the width of the newly created text filed, which I use for some maths later.
Is there any way to use a gradient fill instead of the color 0xE3D280? Or must I make the text as a mask for a gardient fill layer?


Reply With Quote