Can somebody help me with this. I have a file that pulls a list of states
(I am only working with Idaho right now) and loads the names into my flash movie. Everything works til it gets to the this.onMouseDown = function(). For some
reason I cannot get it to activate the state any ideas?
var StatesList:LoadVars = new LoadVars();
StatesList.load("stateListings.asp");
var Idaho_x:Number = 94.9;
var Idaho_y:Number = 21.9;
this.createTextField("StatesText", 500, 150, 80, 300, 40);
StatesList.onLoad = function() {
var arrStates:Array = new Array(StatesList.strStates);
for(var i:Number=0;i<=arrStates.length-1;++i){
var currButton = attachMovie(arrStates[i], arrStates[i], i+2);
currButton._x = eval(arrStates[i] + "_x");
currButton._y = eval(arrStates[i] + "_y");
var newColor:Color = new Color(currButton);
newColor.setRGB(0xE1E2E3);
StatesText.text = arrStates[i];
//From here on down is the section that will not work.
currButton.onMouseDown = function(){
ActivateState(arrStates[i]);
}
}
}
function ActivateState(thisState){
var currColor:Color = new Color(thisState);
if (currColor.getRGB() == 0xFBE600) {
//Change the state color to Gray
currColor.setRGB(0xE1E2E3);
//more processing code to come later
} else {
//Change the state color to Yellow
currColor.setRGB(0xFBE600);
//more processing code to come later
}
};
you can see the working code
http://www.ivievendors.com/problemchild/states2.html
Many Thanks
Mike