as you see this is a class create 4 text Fields , what i woona do is in this line of code first1[i].text = k1[i]; in the for loop to write the randomize numbers in the TextFields
that's my code
import flash.display.Sprite;
import flash.display.DisplayObjectContainer;
import flash.display.InteractiveObject;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
public class addClass extends Sprite {
public var first1:Array = new Array();
public var i:uint;
public var k1:Array = new Array();
public function addClass() {
for (i= 1 ; i<= 5; i++)
{ first1[i]= createCustomTextField(100,(i*40),50,30);
k1[i]=Math.round(Math.random()*10);
// here is the problem
first1[i].text = k1[i];
}
private function createCustomTextField(x:Number, y:Number, width:Number, height:Number):TextField
{
var result:TextField=new TextField ;
var format:TextFormat = new TextFormat();
result.x=x;
result.y=y;
result.width=width;
result.height=height;
result.background=false;
result.border=true;
result.selectable=false;
result.restrict="0-9";
format.size = 24;
format.color = 0xFFFFFF;
result.defaultTextFormat = format;
addChild(result);
return result;
}