# Populating dynamic textfield question

**URL:** <https://forum.kirupa.com/t/populating-dynamic-textfield-question/308536>\
**Category:** Uncategorized\
**Created:** [April 25, 2010, 6:32am UTC](https://forum.kirupa.com/t/populating-dynamic-textfield-question/308536 "2010-04-25T06:32:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobthebob](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@bobthebob](https://forum.kirupa.com/u/bobthebob)\
**Post date:** [April 25, 2010, 6:32am UTC](https://forum.kirupa.com/t/populating-dynamic-textfield-question/308536/1 "2010-04-25T06:32:15Z")

</div>

so, I’ve got the following in an .as Class file called PIX, there is another .as Class file for the Sprite object ‘px’ that contains a dynamic textfield called pxText I’m trying to populate with the value of the variable ‘j’.  
here’s the code I got to work:

```auto
public function init():void {
     pxRow = stage.stageWidth / 10;	
	for(var j:uint = 0; j < pxRow; j++) {
		px = new Pixie();
		addChild(px);
		px.x = j*10;
		px.y = 0;
		trace(j);
		px.pxText.text = ""+j;
	}

```

but when I try this (which is really what I want to do):

```auto
px.pxText.text = j;

```

I get Error #1067  
how do I simply display the value of the variable ‘j’?  
I’ve tried

```auto
px.pxText.text = j as String;

```

```auto
px.pxText.text = j as text;

```

```auto
px.pxText.text = [j];

```

none of them have worked…  
the trace(j) statement works so it’s not any kind of problem with the variable itself. I’m sure there’s a simple answer but I’ll be ■■■■■■ if I can see it right this minute…  
thanks in advance.  
bvb
