How do I write this to load the appropriate image? I want to load the same number as the button I click on. Now I have a trace action where the loading should occur and that only show that I’m loading image number 15 all the time. Anyone?
function hitButton(nbrID) {
btn = _root["btn"+nbrID];
btn.nbrID = nbrID;
btn.onRollOver = function() {
this.alphaTo(100, .5);
}
btn.onRollOut = function() {
this.alphaTo(30, .5);
}
btn.onRelease = function() {
trace (["bilder/" +i] + ".jpg");
btn1._alpha = 30;
btn1.enabled = true;
for (var i = 2; i<15; i++) {
_root["btn"+i]._alpha = 30;
_root["btn"+i].enabled = true;
this._alpha = 100;
this.enabled = false;
}
}
}
for (var i = 1; i<15; i++) {
_root.hitButton(i);
}