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:
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):
px.pxText.text = j;
I get Error #1067
how do I simply display the value of the variable ‘j’?
I’ve tried
px.pxText.text = j as String;
px.pxText.text = j as text;
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