I cannot wrap my head around this simple concept. All I need to do is access the element in myArray at the third position on Mouse Over. I’ve tried myArray*[2] but it come back as the last element in the array. Help is appreciated.
Here is my code.
function xmlLoaded(event:Event):void {
myXML = XML(myLoader.data);
trace("Data loaded.");
for each (var property:XML in myXML.item) {
var id:Number = Number(property.attribute("id"));
var s:String = String(property.stateName);
var f:String = String(property.formNum);
myArray.push([id, s, f]);
}
colorStates();
}
function colorStates():void {
var a:ColorTransform = new ColorTransform();
for (var i:Number = 0; i<myArray.length; i++) {
this[myArray*[1]].addEventListener(MouseEvent.MOUSE_OVER, manageMouseOver);
this[myArray*[1]].addEventListener(MouseEvent.MOUSE_OUT, manageMouseOut);
if (myArray*[2] == "NA") {
a.color = (0xb3b3b3);
this[myArray*[1]].transform.colorTransform = a;
} else {
a.color = (0x1883c7);
this[myArray*[1]].transform.colorTransform = a;
}
function manageMouseOver(e:MouseEvent):void {
trace("Over " + e.target.name);
Here -- > label.htmlText = "<b>"+ e.target.name +"</b><br>"+ myArray[0][2]; <--- Here
}
function manageMouseOut(e:MouseEvent):void {
trace("Out");
label.htmlText = "";
}
}
}