This code keeps coming back with the same value for i when the button is clicked. It is looping through but only the last value gets passed. Any help would be great.
for(var i:uint=0; i<10; i++)
{
this[“Nav”+(i+1)].addEventListener(MouseEvent.CLICK, runNav);
function runNav(event:Event):void
{
dispatchEvent(new changeNav(i+1))
}
}
Cheers!