Skip to main content
Participating Frequently
August 10, 2008
Question

variables in target path?

  • August 10, 2008
  • 2 replies
  • 388 views
I have been searching all over and cannot find a solution to this problem. It works fine when I hard code it but I am trying to get this to work with the for next loop. It apears that the variable arrays are giving me a problem. Whatever I try gives me "TypeError: Error #1010: A term is undefined and has no properties"

Code below:

var menuCurrentPos:Array = new Array(0,1,2,3,4,6);
var menuDefaultPos:Array = new Array(0,1,2,3,4,6);
var menuMCArray:Array = new Array("btnAbout_mc", "btnCustDes_mc", "btnMaint_mc", "btnLogos_mc", "btnWebDesign_mc", "btnHome_mc");

for (var i:Number = 0; i < menuMCArray.length; i++) {
trace("i: " + i + " " + menuMCArray.length + " " + menuMCArray + " " + menuCurrentPos);
this.menuTabs_mc.setChildIndex(menuTabs_mc.menuMCArray , menuCurrentPos);
menuTabs_mc.menuMCArray .addEventListener(MouseEvent.ROLL_OVER, buttonOver);
menuTabs_mc.menuMCArray
.addEventListener(MouseEvent.ROLL_OUT, buttonOut);
}

Any suggestions would be appreciated.

Thanks
This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
August 11, 2008
good.
kglad
Community Expert
Community Expert
August 10, 2008
use the attach code option to display code in this forum.
WhertogoAuthor
Participating Frequently
August 11, 2008
Sorry.

Here is the code extract. All of it is from my document class.

Thanks
WhertogoAuthor
Participating Frequently
August 11, 2008
Found the problem. Dumb mistake forgot to enclose the variable in brackets. Follows the old axiom that the longer you stare the more right it is. Had to get away from it for awhile.

should be: