-
[RESOLVED] TextFields and Tab Orders
Hi all !
I have created a row of textfields with each textfield having its own unique identification number. The total number of rows of textfields is 20 and when i displayed them on the stage, they did not fit on the screen. However I tried out the tab order and it was perfect. It ran down from 1 to 20 with no problems. However to keep all of them on the same screen I decided to split them up in two columns with 10 in each column. I managed to do that by changing the y offset of the field after the 10th field. Now however, when i tried the tab order it was correct for the first column but after the 10th ( last field in column 1 ) it went to the 18th textfield !?? the 2nd last textfield in the 2nd column.
I checked and printed the values of textfields tab order and they were correct. SO i do not know what's causing this issue.
Anyone has any ideas or faced a similar issue ever?
Thanks all !
-
.
Hi,
Without having any of your code or files, try either of these, they do it two different ways, you will see what i mean.
paste any or both of these, separately, into an new AS2 document and test.
V:1
PHP Code:
var textFieldAmount:Number = 20;
var divider:Number = 10;
var uniqueNumber:Number;
var hSpace:Number = 300;
var vSpace:Number = 25;
for (var i = 0; i < textFieldAmount; i++)
{
this.createTextField('Text_' + i,i,20 + Math.floor(i / divider) * hSpace,20 + Math.floor(i % divider) * vSpace,0,0);
this["Text_" + i].tabIndex = i;
this["Text_" + i].uniqueNumber = i;
this["Text_" + i].autoSize = true;
this["Text_" + i].border = true;
this["Text_" + i].type = "input";
this["Text_" + i].text = "Textfield: " + String(i + 1) + " TabIndex: " + this["Text_" + i].tabIndex;
}
V:2
PHP Code:
var textFieldAmount:Number = 20;
var divider:Number = 2;
var uniqueNumber:Number;
var hSpace:Number = 300;
var vSpace:Number = 25;
for (var i = 0; i < textFieldAmount; i++)
{
this.createTextField('Text_' + i,i,20 + Math.floor(i % divider) * hSpace,20 + Math.floor(i / divider) * vSpace,0,0);
this["Text_" + i].tabIndex = i;
this["Text_" + i].uniqueNumber = i;
this["Text_" + i].autoSize = true;
this["Text_" + i].border = true;
this["Text_" + i].type = "input";
this["Text_" + i].text = "Textfield: " + String(i + 1) + " TabIndex: " + this["Text_" + i].tabIndex;
}
but without seeing your code one can only guess as to how you want it to look and do.
-
Hi fruitbeard,
Thanks again for the reply. I'll try out your files and revert. I'll try and get my files here by tomorrow if I am still not able to figure out the problem with the help of your files. I am really grateful. Thanks loads.
-
Hi fruitbeard,
On comparison with my code I realised that I had not used the tabIndex property. Surprisingly , earlier & elsewhere when I have used textfield, I do not recall using this tabIndex property and yet the tab worked correctly. I think I read somewhere that the 2nd parameter in createTextField function took care of the tabIndexes. So now I wonder what that is for.
But yes using tabIndex property solved the issue perfectly.
So thanks again. Will be back for more.
P.S. I had posted my reply some days ago but for some reason it did not post and was saved in the quick reply box from where I have retrieved it now and re-posting it.
Tags for this Thread
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
|