Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The TAB question again w/the script 1

Status
Not open for further replies.

natedeia

Technical User
May 8, 2001
365
US

I posted a question the other day and got the answer I was needing and applied it. Weird thing is that at the above link found the same script but when i put it to use that it just gives me a bunch of errors. So still have not got it to work. The below is the error. Then I have my script below it....anyone, anyone??


Scene=Scene 1, Layer=fields, Frame=1: Line 1: Mouse events are permitted only for button instances
on (keypress &quot;<Tab>&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 6: 'else' encountered without matching 'if'
} else if (Selection.getFocus() == &quot;_level0.creditor1&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 8: 'else' encountered without matching 'if'
} else if (Selection.getFocus() = &quot;_level0.balance1&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 10: Left side of assignment operator must be variable or property.
} else if (Selection.getFocus() = &quot;_level0.minpymt1&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 14: 'else' encountered without matching 'if'
} else if (Selection.getFocus() = &quot;_level0.creditor2&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 16: Left side of assignment operator must be variable or property.
} else if (Selection.getFocus() = &quot;_level0.balance2&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 20: 'else' encountered without matching 'if'
} else if (Selection.getFocus() = &quot;_level0.interestrate2&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 24: 'else' encountered without matching 'if'
} else if (Selection.getFocus() == &quot;_level0.balance3&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 26: 'else' encountered without matching 'if'
} else if (Selection.getFocus() = &quot;_level0.minpymt3&quot;) {

Scene=Scene 1, Layer=fields, Frame=1: Line 28: Left side of assignment operator must be variable or property.
} else if (Selection.getFocus() = &quot;_level0.interestrate3&quot;) {



???????????????????????????????????????????????????????


on (keypress &quot;<Tab>&quot;) {
if (Selection.getFocus() == &quot;_level0.firstname&quot;) {
Selection.setFocus(&quot;_level0.lastname&quot;);
} else if (Selection.getFocus() == &quot;_level0.lastname&quot;) {
Selection.setFocus(&quot;_level0.creditor1&quot;); {
} else if (Selection.getFocus() == &quot;_level0.creditor1&quot;) {
Selection.setFocus(&quot;_level0.balance1&quot;); {
} else if (Selection.getFocus() = &quot;_level0.balance1&quot;) {
Selection.setFocus(&quot;_level0.minpymt1&quot;);
} else if (Selection.getFocus() = &quot;_level0.minpymt1&quot;) {
Selection.setFocus(&quot;_level0.interestrate1&quot;);
} else if (Selection.getFocus() == &quot;_level0.interestrate1&quot;) {
Selection.setFocus(&quot;_level0.creditor2&quot;); {
} else if (Selection.getFocus() = &quot;_level0.creditor2&quot;) {
Selection.setFocus(&quot;_level0.balance2&quot;);
} else if (Selection.getFocus() = &quot;_level0.balance2&quot;) {
Selection.setFocus(&quot;_level0.minpymt2&quot;);
} else if (Selection.getFocus() == &quot;_level0.minpymt2&quot;) {
Selection.setFocus(&quot;_level0.interestrate2&quot;); {
 
This code works I just made it :

Code:
onClipEvent (load) {
	Selection.setFocus(&quot;_parent.box1&quot;);
	var myArray = new Array('box1', 'box2', 'box3', 'box4','box5','box6');
}
onClipEvent (enterFrame) {
	if (Key.getCode() == 9) {
		for (var x = 0; x<myArray.length+1; x++) {
			if (Selection.getFocus() == myArray[x]) {
				Selection.setFocus(&quot;_parent.&quot;+myArray[x+1]);
			}
		}
	}
}
Regards

Big Bad Dave

davidbyng@hotmail.com
 
Yours works, but if you place the boxes with the box1 as the bottom and box2, box3, box4, box5 above them, it will still TAB through them from top to bottom. So it is not actually following all the script. Do you know how to correct this?
 
nah actually it dosn't work and I can't be bothered to fix it tonight maybee tomorrow Regards

Big Bad Dave

davidbyng@hotmail.com
 
Ok then. Thanks for the time spent on it, I will keep searching for the answer. I don't want you to have to spend much more time on it, it's my prob so I will do the searching. Thanks dave.
 
I could only get it to work without using arrays, oh well :



onClipEvent (load) {
Selection.setFocus(&quot;_parent.box0&quot;);
}
onClipEvent (keyDown) {
if (Selection.getFocus() == &quot;_level0.box0&quot; && Key.isDown(Key.TAB)) {
Selection.setFocus(&quot;_level0.box4&quot;);
} else if (Selection.getFocus() == &quot;_level0.box1&quot; && Key.isDown(Key.TAB)) {
Selection.setFocus(&quot;_level0.box3&quot;);
} else if (Selection.getFocus() == &quot;_level0.box2&quot; && Key.isDown(Key.TAB)) {
Selection.setFocus(&quot;_level0.box0&quot;);
} else if (Selection.getFocus() == &quot;_level0.box3&quot; && Key.isDown(Key.TAB)) {
Selection.setFocus(&quot;_level0.box2&quot;);
} else if (Selection.getFocus() == &quot;_level0.box4&quot; && Key.isDown(Key.TAB)) {
Selection.setFocus(&quot;_level0.box1&quot;);
}
}


Regards

Big Bad Dave

davidbyng@hotmail.com
 
Dave, hey I used a sample of the above script you supplied and put it in and so far so good. I have 60 fields so far it worked for the first row. Thanks a Mil!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top