Hi,
Im trying to create a grid of textfields and dynamically attach a UIScrollBar component to each textfield. I cant seem to do it. Here is the code I have:
var gn:Number;
gn = 1;
for (c=1; c<9; c++) {
for (i=1; i<9; i++) {
px = 100*i;
py = 40*c;
_root.createTextField("grid"+gn, gn, px+i*10, py+200+c*10, 100, 40);
with (_root["grid"+gn]) {
multiline = true;
wordWrap = true;
border = true;
autoSize = "true";
type = "dynamic";
font = "Arial";
backgroundColor = 0xfff000;
text = "yvette is trying to make this work but really doesnt know how to use components";
background = "true";
}
initialization = {_targetInstanceName:"grid"+gn, horizontal:false};
//your initialisation object
_root.attachMovie('UIScrollBar', "myScrollbar"+gn, gn+65, initialization);
//attach scrollbar
_root["myScrollBar"+gn]._x = px;
_root["myScrollBar"+gn].setSize(40);
gn = gn+1;
}
}
Where have I gone wrong?
Thanks,
Yvette