I tried everything, it works perfectly without the loop but when I try to put it in a loop it displays nothing.
I figured out it has something to do with the naming of mytext, It seems it needs to be quoted I colored red where I think the fault is.
xwaarde = 20;
for(i=0;i<3;i++){
mytext = "mytext"+i;
_root.createTextField([COLOR=Red]mytext[/COLOR], i, xwaarde, 100, 50, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.text = "this is my first test field object text";
xwaarde = xwaarde+80;
}
the following works perfectly :
xwaarde = 20;
_root.createTextField("mytext", 0, xwaarde, 100, 50, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.text = "this is my first test field object text";
mytext.multiline = true; - this is addresing a “mytext” movie not “mytext”+i as you supposed.
Try using “with” … something like this.
xwaarde = 20;
for(i=0;i<3;i++){
mytext = "mytext"+i;
_root.createTextField(mytext, i, xwaarde, 100, 50, 100);
with ("mytext"+i){
multiline = true;
wordWrap = true;
border = true;
text = "this is my first test field object text";}
xwaarde = xwaarde+80;
}
Hope it works
Later Edit:
Actually a “with(mytext)” statement should work also
I believe it should work. I don’t have flash here and haven’t tested
Let me know if works
is there something worng with the “with” statement?
I mean i used it that way when I had this problem… but maybe is this deprecated or something? Or is only a reason of habit?
Later Edit… My first post was indeed wrong but i told you I could be missing something :P. Forgoted the “eval”