I am having a problem getting this to work. I get this error:
TypeError: Error #1010: A term is undefined and has no properties.
It is because of the line of code in bold. It doesn’t like the this[NavName]. Any suggestions?
for(var i:Number=0; i<11; i++)
{
var num:Number = i;
var NavName:String = “Nav” + num;
** this[NavName].addEventListener(MouseEvent.CLICK, runNav);
**
function runNav(event:Event):void
{
trace(“hello”);
dispatchEvent(new changeNav(num))
}
}
Cheers!