|
-
Selection.setFocus concatenate
Hi All,
I have textfields named 'strText' inside 10 movieclips named 'field0', 'field1', 'field2' .... and so on!
I'm trying to chech whether a field is empty or not and then set the selection to the first empty textfield.
But this doesn't work?
PHP Code:
function setFocus () {
for(i=0;i<10;i++) {
if(["field"+i].strText.text eq "") {
Selection.setFocus(["field"+i].strtext);
break;
}
}
}
Give it up ... 
//pod
-
Probably because break doesn't do what you think! It is exclusively used in Switch with ActionScript.
PHP Code:
function setFocus () {
for(var i=0;i<10;i++) {
if(this["field"+i].strText.text != "") {
Selection.setFocus(this["field"+i].strText);
i=10;
}
}
}
-
hmm ... still doesn't work ...
I have attached a sample file if you care to take look?
btw: the 'break' command DOES work
Code:
myNum=5;
for(i=0;i<10;i++) {
trace(i);
if(i==myNum) {
break;
}
}
-
hmmm..
I think you are wrong.. a break can be used in loops as well.
-
Fair cop.
Next time I'll check the syntax guide.
-
field0.strtext.tabIndex = 1;
field1.strtext.tabIndex = 2;
field2.strtext.tabIndex = 3;
field3.strtext.tabIndex = 4;
field4.strtext.tabIndex = 5;
field5.strtext.tabIndex = 6;
countrydrop.tabIndex = 7;
field6.strtext.tabIndex = 8;
field7.strtext.tabIndex = 9;
field8.tabIndex = 10;
once I assigned tabindexes everything worked fine
//pod
-
maybe because you got many fields..
nice note.. thanks for the info.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|