# Text disappears from dynamic textfields

**URL:** <https://forum.kirupa.com/t/text-disappears-from-dynamic-textfields/298135>\
**Category:** flash\
**Created:** [October 14, 2009, 3:13am UTC](https://forum.kirupa.com/t/text-disappears-from-dynamic-textfields/298135 "2009-10-14T03:13:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drkb](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@drkb](https://forum.kirupa.com/u/drkb)\
**Post date:** [October 14, 2009, 3:13am UTC](https://forum.kirupa.com/t/text-disappears-from-dynamic-textfields/298135/1 "2009-10-14T03:13:24Z")

</div>

I am making some progress with an interactive poetry project I requested help on earlier. Unfortunately I have another problem which I can’t seem to solve. In the project I create 49 textfields in a 7x7 grid. The properties are stored in an array. The code I have to do this works as intended.

var instances:Array = [];  
for (var i:int = 0; i \< 49; i++) {  
var j\_inst:TextField = new TextField();  
j\_inst.text = “s”;  
j\_inst.width =50;  
j\_inst.x = (i % 7)\*40+550;  
j\_inst.y = Math.floor(i/7)\*25+100;  
j\_inst.selectable = false;  
j\_inst.border = false;  
j\_inst.autoSize = TextFieldAutoSize.CENTER;  
var myFormat:TextFormat = new TextFormat();  
myFormat.font = “Arial”;  
myFormat.color = 0xFFFFFF;  
myFormat.size = 24;  
j\_inst.setTextFormat(myFormat);  
addChild(j\_inst);  
instances.push(j\_inst);  
}

The problem occurs when I try and change the text - in this case to the letter “O”. The textfield simply is cleared with nothing displayed. Here is the code for that -

function tickTock(e:TimerEvent):void {  
for (var j:int = 0; j \< 49; j++) {  
instances[j].text=“O”;  
}  
}

If I trace the .text contents of the array it has been changed correctly to “O”. It just doesn’t display properly. Changing other properties such as x, y works as expected. I’ve tried with embedded and non-embedded fonts. Doesn’t make a difference. I’ve tried some different blend modes and still no success. I suspect it’s some kind of rendering issue but I’m totally stuck.

Any suggestions??

Thanks,

drkb
